Esempio n. 1
0
 /// <summary>
 /// Return an list of points defining an isosceles triangle
 /// </summary>
 /// <param name="pos">The base location</param>
 /// <param name="range">The height of the triangle</param>
 /// <param name="angle">The rotation angle of the triangle</param>
 /// <param name="halfangle">Half the angle between the 2 longer sides</param>
 /// <returns>The isosceles triangle</returns>
 public static PointF[] CreateHitTriangle(this PointF pos, float range, float angle, float halfangle)
 {
     PointF[] pts = new PointF[3];
     pts[0] = pos;
     pts[1] = pos.CalculateNewPoint(angle.ContinuousAngleAddition(halfangle), range);
     pts[2] = pos.CalculateNewPoint(angle.ContinuousAngleSubtraction(halfangle), range);
     return(pts);
 }