示例#1
0
 /// <summary>
 /// Finds the direction of the vector from the origin to the specified (x, y) point.
 /// </summary>
 /// <param name="x">The x-coordinate.</param>
 /// <param name="y">The y-coordinate.</param>
 /// <returns>The direction of the vector from the origin to the specified point.</returns>
 public static Angle Direction(double x, double y) => GMath.Atan2(y, x);
示例#2
0
 /// <summary>
 /// Finds the direction of the vector from the origin to the specified point.
 /// </summary>
 /// <param name="p">The point.</param>
 /// <returns>The direction of the vector from the origin to the specified point.</returns>
 public static Angle Direction(Point p)
 => GMath.Atan2(p.Y, p.X);
示例#3
0
 /// <summary>
 /// Finds the direction of the vector from the point (x1,y1) to the point (x2,y2).
 /// </summary>
 /// <param name="xFrom">The x-coordinate of the first point.</param>
 /// <param name="yFrom">The y-coordinate of the first point.</param>
 /// <param name="xTo">The x-coordinate of the second point.</param>
 /// <param name="yTo">The y-coordinate of the second point.</param>
 /// <returns>The direction of the vector from the first to the second point.</returns>
 public static Angle Direction(double xFrom, double yFrom, double xTo, double yTo)
 => GMath.Atan2(yTo - yFrom, xTo - xFrom);