Ejemplo n.º 1
0
        static public float CalculateTriangleArea(this VectorF2 point1, VectorF2 point2, VectorF2 point3)
        {
            float a;
            float b;
            float c;

            point1.GetDistanceTo(point2).Order(
                point2.GetDistanceTo(point3),
                point3.GetDistanceTo(point1),
                out c, out b, out a
                );

            float ab = a - b;

            float t1 = a + (b + c);
            float t2 = c - ab;
            float t3 = c + ab;
            float t4 = a + (b - c);

            return(0.25f * Mathq.Sqrt(t1 * t2 * t3 * t4));
        }
Ejemplo n.º 2
0
 static public float GetMagnitude(this VectorI2 item)
 {
     return(Mathq.Sqrt(item.GetSquaredMagnitude()));
 }