// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Vector3d.java

package vecmath;

import java.io.Serializable;

// Referenced classes of package javax.vecmath:
//            Tuple3d, Vector3f, Tuple3f

public class Vector3d extends Tuple3d
    implements Serializable
{

    public Vector3d(double d, double d1, double d2)
    {
        super(d, d1, d2);
    }

    public Vector3d(double ad[])
    {
        super(ad);
    }

    public Vector3d(Vector3d vector3d)
    {
        super(vector3d);
    }

//    public Vector3d(Vector3f vector3f)
//    {
//        super(vector3f);
//    }

//    public Vector3d(Tuple3f tuple3f)
//    {
//        super(tuple3f);
//    }

    public Vector3d(Tuple3d tuple3d)
    {
        super(tuple3d);
    }

    public Vector3d()
    {
    }

    public final void cross(Vector3d vector3d, Vector3d vector3d1)
    {
        double d = vector3d.y * vector3d1.z - vector3d.z * vector3d1.y;
        double d1 = vector3d1.x * vector3d.z - vector3d1.z * vector3d.x;
        z = vector3d.x * vector3d1.y - vector3d.y * vector3d1.x;
        x = d;
        y = d1;
    }

    public final void normalize(Vector3d vector3d)
    {
        double d = 1.0D / Math.sqrt(vector3d.x * vector3d.x + vector3d.y * vector3d.y + vector3d.z * vector3d.z);
        x = vector3d.x * d;
        y = vector3d.y * d;
        z = vector3d.z * d;
    }

    public final void normalize()
    {
        double d = 1.0D / Math.sqrt(x * x + y * y + z * z);
        x *= d;
        y *= d;
        z *= d;
    }

    public final double dot(Vector3d vector3d)
    {
        return x * vector3d.x + y * vector3d.y + z * vector3d.z;
    }

    public final double lengthSquared()
    {
        return x * x + y * y + z * z;
    }

    public final double length()
    {
        return Math.sqrt(x * x + y * y + z * z);
    }

    public final double angle(Vector3d vector3d)
    {
        double d = dot(vector3d) / (length() * vector3d.length());
        if(d < -1D)
            d = -1D;
        if(d > 1.0D)
            d = 1.0D;
        return Math.acos(d);
    }

    static final long serialVersionUID = 0x343533bc7f4d2f2aL;
}
