开平方的方法
return math.sqrt(temp)
开平方的方法
return math.sqrt(temp)
public double x;
struct Vector3
{
public double x;
public double y;
public double z;
public double Distance()
{
double r = Math.Sqrt(x * x + y * y + z * z);
Console.WriteLine(r);
return r;
}
}
static void test11()
{
Vector3 vector1;
vector1.x = 1;
vector1.y = 2;
vector1.z = 2;
vector1.Distance();
}
static void Main(string[] args)
{
test11();
}
sqrt
结构体练习
(可以理解简单版的)