Ejemplo n.º 1
0
    public static void Dot(ref Vector2d lhs, ref Vector2d rhs, out FInt ret)
    {
        FInt fInt;

        lhs.x.Multiply(rhs.x.RawValue, out ret);
        lhs.y.Multiply(rhs.y.RawValue, out fInt);
        ret.Add(fInt.RawValue, out ret);
    }
Ejemplo n.º 2
0
    public FInt SqrMagnitude(out FInt ret)
    {
        FInt fInt;

        this.x.Multiply(this.x.RawValue, out ret);
        this.y.Multiply(this.y.RawValue, out fInt);
        ret.Add(fInt.RawValue, out ret);
        return(ret);
    }
Ejemplo n.º 3
0
    public FInt Magnitude(out FInt ret)
    {
        //ret = new FInt();
        FInt fInt;
        FInt fInt1;

        this.x.AbsoluteValue(out fInt);
        if (fInt.RawValue == (long)0)
        {
            if (this.y.RawValue == (long)-1 || this.y.RawValue == (long)1)
            {
                ret.RawValue = (long)1048576;
            }
        }
        else if (fInt.RawValue == (long)1 && this.y.RawValue == (long)0)
        {
            ret.RawValue = (long)1048576;
        }
        this.x.Multiply(this.x.RawValue, out ret);
        this.y.Multiply(this.y.RawValue, out fInt1);
        ret.Add(fInt1.RawValue, out ret);
        Mathd.Sqrt(ret.RawValue, out ret);
        return(ret);
    }