1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-09 23:25:43 +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
{
/// <summary>
/// Converts an angle from degrees to radians.
/// Converts the current angle in degrees to its equivalent represented in radians.
/// </summary>
/// <param name="angle">The angle in degrees.</param>
/// <returns>Returns <paramref name="angle" /> in radians.</returns>
/// <param name="angle">The angle in degrees to convert.</param>
/// <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)
{
return Math.PI * angle / 180.0;
@ -99,10 +102,13 @@ namespace X10D.DoubleExtensions
}
/// <summary>
/// Converts an angle from radians to degrees.
/// Converts the current angle in radians to its equivalent represented in degrees.
/// </summary>
/// <param name="angle">The angle in radians.</param>
/// <returns>Returns <paramref name="angle" /> in degrees.</returns>
/// <param name="angle">The angle in radians to convert.</param>
/// <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)
{
return angle * (180.0 / Math.PI);

View File

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