예제 #1
0
        /// <summary>
        /// Calculates the distance between 2 points.
        /// </summary>
        /// <param name="from">First point to compare.</param>
        /// <param name="to">Point to compare to.</param>
        /// <returns></returns>
        public static float GetDistance(PointF from, PointF to)
        {
            float a = from.X - to.X;
            float b = from.Y - to.Y;

            return(ExtMaths.GetHypotenuse(a, b));
        }
예제 #2
0
 /// <summary>
 /// Returns the angle in degrees from the passed point in comparision
 /// to the x-axis of the centerpoint passed.
 /// </summary>
 /// <param name="centerPoint">Center point for the x-axis to calculate the angle against.</param>
 /// <param name="point">The point to compare against the x-axis.</param>
 /// <returns>Degrees between the point and the center point.</returns>
 public static float GetAngle(PointF centerPoint, PointF point)
 {
     return(ExtMaths.RadiansToDegrees(PointTransform.GetAngleRadiansTan(centerPoint, point)));
 }