You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-22 15:06:45 +00:00
Remove cartesian2polar and polar2cartesian
This commit is contained in:
@@ -109,19 +109,6 @@ namespace Godot
|
||||
return (real_t)Math.Atan2(y, x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a 2D point expressed in the cartesian coordinate
|
||||
/// system (X and Y axis) to the polar coordinate system
|
||||
/// (a distance from the origin and an angle).
|
||||
/// </summary>
|
||||
/// <param name="x">The input X coordinate.</param>
|
||||
/// <param name="y">The input Y coordinate.</param>
|
||||
/// <returns>A <see cref="Vector2"/> with X representing the distance and Y representing the angle.</returns>
|
||||
public static Vector2 Cartesian2Polar(real_t x, real_t y)
|
||||
{
|
||||
return new Vector2(Sqrt(x * x + y * y), Atan2(y, x));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rounds `s` upward (towards positive infinity).
|
||||
/// </summary>
|
||||
@@ -435,19 +422,6 @@ namespace Godot
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a 2D point expressed in the polar coordinate
|
||||
/// system (a distance from the origin `r` and an angle `th`)
|
||||
/// to the cartesian coordinate system (X and Y axis).
|
||||
/// </summary>
|
||||
/// <param name="r">The distance from the origin.</param>
|
||||
/// <param name="th">The angle of the point.</param>
|
||||
/// <returns>A <see cref="Vector2"/> representing the cartesian coordinate.</returns>
|
||||
public static Vector2 Polar2Cartesian(real_t r, real_t th)
|
||||
{
|
||||
return new Vector2(r * Cos(th), r * Sin(th));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a canonical Modulus operation, where the output is on the range `[0, b)`.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user