// 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:   Vector4d.java

package vecmath;

import java.io.Serializable;

// Referenced classes of package javax.vecmath:
//            Tuple4d, Tuple3d, Vector4f, Tuple4f

public class Vector4d extends Tuple4d
    implements Serializable
{

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

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

    public Vector4d(Vector4d vector4d)
    {
        super(vector4d);
    }

//    public Vector4d(Vector4f vector4f)
//    {
//        super(vector4f);
//    }
//
//    public Vector4d(Tuple4f tuple4f)
//    {
//        super(tuple4f);
//    }

    public Vector4d(Tuple4d tuple4d)
    {
        super(tuple4d);
    }

//    public Vector4d(Tuple3d tuple3d)
//    {
//        super(tuple3d.x, tuple3d.y, tuple3d.z, 0.0D);
//    }

    public Vector4d()
    {
    }

//    public final void set(Tuple3d tuple3d)
//    {
//        x = tuple3d.x;
//        y = tuple3d.y;
//        z = tuple3d.z;
//        w = 0.0D;
//    }

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

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

    public final double dot(Vector4d vector4d)
    {
        return x * vector4d.x + y * vector4d.y + z * vector4d.z + w * vector4d.w;
    }

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

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

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

    static final long serialVersionUID = 0x36a70663a02a5ffcL;
}
