Esempio n. 1
0
    public ivector3d cross_product(ivector3d other)
    {
        double i = y * other.z - z * other.y;
        double j = z * other.x - x * other.z;
        double k = x * other.y - y * other.x;

        return(new vector3d(i, j, k));
    }
Esempio n. 2
0
    // interface implementations
    public ivector3d crossP(ivector3d v)
    {
        double s1 = Y * v.Z - Z * v.Y;
        double s2 = Z * v.X - X * v.Z;
        double s3 = X * v.Y - Y * v.X;

        return(new vector3d(s1, s2, s3));
    }
Esempio n. 3
0
    public ivector3d cross_product(ivector3d v)
    {
        double xx = y * v.z - z * v.y;
        double yy = z * v.x - x * v.z;
        double zz = x * v.y - y * v.x;

        return(new vector3d(xx, yy, zz));
    }
Esempio n. 4
0
 public double dot_product(ivector3d other)
 {
     return(x * other.x + y * other.y + z * other.z);
 }
Esempio n. 5
0
 public static double dot(ivector3d u, ivector3d v)
 {
     return(u.x * v.x + u.y * v.y + u.z * v.z);
 }
Esempio n. 6
0
 public double dotP(ivector3d v)
 {
     return(X * v.X + Y * v.Y + Z * v.Z);
 }
Esempio n. 7
0
    public static vector3d Cross(ivector3d u, ivector3d v)
    {
        vector3d c = new vector3d(u.y * v.z - u.z * v.y, u.z * v.x - u.x * v.z, u.x * v.y - u.y * v.x);

        return(c);
    }
Esempio n. 8
0
 public double dot_product(ivector3d v)
 {
     return(x * v.x + y * v.y + z * v.z);
 }