Exemple #1
0
        public float AngleBetween(IVector2D v)
        {
            IVector2D u1 = UnitVector();
            IVector2D u2 = v.UnitVector();

            float dp = u1.DotProduct(u2);

            var f = (float)Math.Acos(dp);

            return f.ToDegrees();
        }
Exemple #2
0
        public Range ProjectOnto(IVector2D onto)
        {
            IVector2D ontoUnit = onto.UnitVector();

            float min = ontoUnit.DotProduct(Point1);
            float max = ontoUnit.DotProduct(Point2);
            var r = new Range(min, max);
            r = r.SortRange();

            return r;
        }