1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-14 16:15:41 +00:00

(#15) Improve xmldoc for Deg <-> Rad methods

This commit is contained in:
Oliver Booth 2021-03-10 13:02:44 +00:00
parent 643a254b87
commit 08e89d3ab0
2 changed files with 24 additions and 12 deletions

View File

@ -8,10 +8,13 @@ namespace X10D.DoubleExtensions
public static class DoubleExtensions public static class DoubleExtensions
{ {
/// <summary> /// <summary>
/// Converts an angle from degrees to radians. /// Converts the current angle in degrees to its equivalent represented in radians.
/// </summary> /// </summary>
/// <param name="angle">The angle in degrees.</param> /// <param name="angle">The angle in degrees to convert.</param>
/// <returns>Returns <paramref name="angle" /> in radians.</returns> /// <returns>
/// <paramref name="angle" /> converted from degrees to radians by calculating
/// <c><paramref name="angle" />π / 180</c>.
/// </returns>
public static double DegreesToRadians(this double angle) public static double DegreesToRadians(this double angle)
{ {
return Math.PI * angle / 180.0; return Math.PI * angle / 180.0;
@ -99,10 +102,13 @@ namespace X10D.DoubleExtensions
} }
/// <summary> /// <summary>
/// Converts an angle from radians to degrees. /// Converts the current angle in radians to its equivalent represented in degrees.
/// </summary> /// </summary>
/// <param name="angle">The angle in radians.</param> /// <param name="angle">The angle in radians to convert.</param>
/// <returns>Returns <paramref name="angle" /> in degrees.</returns> /// <returns>
/// <paramref name="angle" /> converted from radians to degrees by calculating
/// <c><paramref name="angle" />(180 / π)</c>.
/// </returns>
public static double RadiansToDegrees(this double angle) public static double RadiansToDegrees(this double angle)
{ {
return angle * (180.0 / Math.PI); return angle * (180.0 / Math.PI);

View File

@ -9,10 +9,13 @@ namespace X10D.SingleExtensions
public static class SingleExtensions public static class SingleExtensions
{ {
/// <summary> /// <summary>
/// Converts an angle from degrees to radians. /// Converts the current angle in degrees to its equivalent represented in radians.
/// </summary> /// </summary>
/// <param name="angle">The angle in degrees.</param> /// <param name="angle">The angle in degrees to convert.</param>
/// <returns>Returns <paramref name="angle" /> in radians.</returns> /// <returns>
/// <paramref name="angle" /> converted from degrees to radians by calculating
/// <c><paramref name="angle" />π / 180</c>.
/// </returns>
public static float DegreesToRadians(this float angle) public static float DegreesToRadians(this float angle)
{ {
return (float)((double)angle).DegreesToRadians(); return (float)((double)angle).DegreesToRadians();
@ -100,10 +103,13 @@ namespace X10D.SingleExtensions
} }
/// <summary> /// <summary>
/// Converts an angle from radians to degrees. /// Converts the current angle in radians to its equivalent represented in degrees.
/// </summary> /// </summary>
/// <param name="angle">The angle in radians.</param> /// <param name="angle">The angle in radians to convert.</param>
/// <returns>Returns <paramref name="angle" /> in degrees.</returns> /// <returns>
/// <paramref name="angle" /> converted from radians to degrees by calculating
/// <c><paramref name="angle" />(180 / π)</c>.
/// </returns>
public static float RadiansToDegrees(this float angle) public static float RadiansToDegrees(this float angle)
{ {
return (float)((double)angle).RadiansToDegrees(); return (float)((double)angle).RadiansToDegrees();