Skip to content

Commit

Permalink
Re-added old methods removed in v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bretleasure authored Jul 12, 2024
1 parent efe2391 commit fd82f33
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/SohCahToa/Trig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static double Rise_RunPrimaryAngle(double run, double primaryAngle)
{
return run * Math.Tan(ToRadians(primaryAngle));
}
public static double a_bAA(double b, double AA) => Rise_RunPrimaryAngle(b, AA);

/// <summary>
/// Calculates the length of the side opposite to the primary angle (rise) given the hypotenuse and the primary angle.
Expand All @@ -29,6 +30,7 @@ public static double Rise_HypotenusePrimaryAngle(double hypotenuse, double prima
{
return hypotenuse * Math.Sin(ToRadians(primaryAngle));
}
public static double a_cAA(double c, double AA) => Rise_HypotenusePrimaryAngle(c, AA);

/// <summary>
/// Calculates the length of the side opposite to the complimentary angle (rise) given the adjacent side (run) and the complimentary angle.
Expand All @@ -40,6 +42,7 @@ public static double Rise_RunComplimentaryAngle(double run, double complimentary
{
return run / Math.Tan(ToRadians(complimentaryAngle));
}
public static double a_bBB(double b, double BB) => Rise_RunComplimentaryAngle(b, BB);

/// <summary>
/// Calculates the length of the side opposite to the complimentary angle (rise) given the hypotenuse and the complimentary angle.
Expand All @@ -51,6 +54,7 @@ public static double Rise_HypotenuseComplimentaryAngle(double hypotenuse, double
{
return hypotenuse * Math.Cos(ToRadians(complimentaryAngle));
}
public static double a_cBB(double c, double BB) => Rise_HypotenuseComplimentaryAngle(c, BB);

/// <summary>
/// Calculates the length of the side opposite to the primary angle (rise) given the adjacent side (run) and the hypotenuse.
Expand All @@ -62,6 +66,7 @@ public static double Rise_RunHypotenuse(double run, double hypotenuse)
{
return Math.Sqrt(Math.Pow(hypotenuse, 2) - Math.Pow(run, 2));
}
public static double a_bc(double b, double c) => Rise_RunHypotenuse(b, c);

/// <summary>
/// Calculates the length of the adjacent side (run) given the opposite side (rise) and the primary angle.
Expand All @@ -73,6 +78,7 @@ public static double Run_RisePrimaryAngle(double rise, double primaryAngle)
{
return rise / Math.Tan(ToRadians(primaryAngle));
}
public static double b_aAA(double a, double AA) => Run_RisePrimaryAngle(a, AA);

/// <summary>
/// Calculates the length of the adjacent side (run) given the hypotenuse and the primary angle.
Expand All @@ -84,6 +90,7 @@ public static double Run_HypotenusePrimaryAngle(double hypotenuse, double primar
{
return hypotenuse * Math.Cos(ToRadians(primaryAngle));
}
public static double b_cAA(double c, double AA) => Run_HypotenusePrimaryAngle(c, AA);

/// <summary>
/// Calculates the length of the adjacent side (run) given the opposite side (rise) and the complimentary angle.
Expand All @@ -95,6 +102,7 @@ public static double Run_RiseComplimentaryAngle(double rise, double complimentar
{
return rise * Math.Tan(ToRadians(complimentaryAngle));
}
public static double b_aBB(double a, double BB) => Run_RiseComplimentaryAngle(a, BB);

/// <summary>
/// Calculates the length of the adjacent side (run) given the hypotenuse and the complimentary angle.
Expand All @@ -106,6 +114,7 @@ public static double Run_HypotenuseComplimentaryAngle(double hypotenuse, double
{
return hypotenuse * Math.Sin(ToRadians(complimentaryAngle));
}
public static double b_cBB(double c, double BB) => Run_HypotenuseComplimentaryAngle(c, BB);

/// <summary>
/// Calculates the length of the adjacent side (run) given the opposite side (rise) and the hypotenuse.
Expand All @@ -117,6 +126,7 @@ public static double Run_RiseHypotenuse(double rise, double hypotenuse)
{
return Math.Sqrt(Math.Pow(hypotenuse, 2) - Math.Pow(rise, 2));
}
public static double b_ac(double a, double c) => Run_RiseHypotenuse(a, c);

/// <summary>
/// Calculates the length of the hypotenuse given the opposite side (rise) and the primary angle.
Expand All @@ -128,6 +138,7 @@ public static double Hypotenuse_RisePrimaryAngle(double rise, double primaryAngl
{
return rise / Math.Sin(ToRadians(primaryAngle));
}
public static double c_aAA(double a, double AA) => Hypotenuse_RisePrimaryAngle(a, AA);

/// <summary>
/// Calculates the length of the hypotenuse given the adjacent side (run) and the primary angle.
Expand All @@ -139,6 +150,7 @@ public static double Hypotenuse_RunPrimaryAngle(double run, double primaryAngle)
{
return run / Math.Cos(ToRadians(primaryAngle));
}
public static double c_bAA(double b, double AA) => Hypotenuse_RunPrimaryAngle(b, AA);

/// <summary>
/// Calculates the length of the hypotenuse given the opposite side (rise) and the complimentary angle.
Expand All @@ -150,6 +162,7 @@ public static double Hypotenuse_RiseComplimentaryAngle(double rise, double compl
{
return rise / Math.Cos(ToRadians(complimentaryAngle));
}
public static double c_aBB(double a, double BB) => Hypotenuse_RiseComplimentaryAngle(a, BB);

/// <summary>
/// Calculates the length of the hypotenuse given the adjacent side (run) and the complimentary angle.
Expand All @@ -161,6 +174,7 @@ public static double Hypotenuse_RunComplimentaryAngle(double run, double complim
{
return run / Math.Sin(ToRadians(complimentaryAngle));
}
public static double c_bBB(double b, double BB) => Hypotenuse_RunComplimentaryAngle(b, BB);

/// <summary>
/// Calculates the length of the hypotenuse given the lengths of the other two sides.
Expand All @@ -172,6 +186,7 @@ public static double Hypotenuse_RiseRun(double rise, double run)
{
return Math.Sqrt(Math.Pow(rise, 2) + Math.Pow(run, 2));
}
public static double c_ab(double a, double b) => Hypotenuse_RiseRun(a, b);

/// <summary>
/// Calculates the primary angle given the complimentary angle.
Expand All @@ -182,6 +197,7 @@ public static double PrimaryAngle_ComplimentaryAngle(double complimentaryAngle)
{
return 90 - complimentaryAngle;
}
public static double AA_BB(double BB) => PrimaryAngle_ComplimentaryAngle(BB);

/// <summary>
/// Calculates the primary angle given the lengths of the opposite side (rise) and the adjacent side (run).
Expand All @@ -193,6 +209,7 @@ public static double PrimaryAngle_RiseRun(double rise, double run)
{
return ToDegrees(Math.Atan(rise / run));
}
public static double AA_ab(double a, double b) => PrimaryAngle_RiseRun(a, b);

/// <summary>
/// Calculates the primary angle given the length of the opposite side (rise) and the hypotenuse.
Expand All @@ -204,6 +221,7 @@ public static double PrimaryAngle_RiseHypotenuse(double rise, double hypotenuse)
{
return ToDegrees(Math.Asin(rise / hypotenuse));
}
public static double AA_ac(double a, double c) => PrimaryAngle_RiseHypotenuse(a, c);

/// <summary>
/// Calculates the primary angle given the length of the adjacent side (run) and the hypotenuse.
Expand All @@ -215,6 +233,7 @@ public static double PrimaryAngle_RunHypotenuse(double run, double hypotenuse)
{
return ToDegrees(Math.Acos(run / hypotenuse));
}
public static double AA_bc(double b, double c) => PrimaryAngle_RunHypotenuse(b, c);

/// <summary>
/// Calculates the complimentary angle given the primary angle.
Expand All @@ -225,6 +244,7 @@ public static double ComplimentaryAngle_PrimaryAngle(double primaryAngle)
{
return 90 - primaryAngle;
}
public static double BB_AA(double AA) => ComplimentaryAngle_PrimaryAngle(AA);

/// <summary>
/// Calculates the complimentary angle given the lengths of the opposite side (rise) and the adjacent side (run).
Expand All @@ -236,6 +256,7 @@ public static double ComplimentaryAngle_RiseRun(double rise, double run)
{
return ToDegrees(Math.Atan(run / rise));
}
public static double BB_ab(double a, double b) => ComplimentaryAngle_RiseRun(a, b);

/// <summary>
/// Calculates the complimentary angle given the length of the opposite side (rise) and the hypotenuse.
Expand All @@ -247,6 +268,7 @@ public static double ComplimentaryAngle_RiseHypotenuse(double rise, double hypot
{
return ToDegrees(Math.Acos(rise / hypotenuse));
}
public static double BB_ac(double a, double c) => ComplimentaryAngle_RiseHypotenuse(a, c);

/// <summary>
/// Calculates the complimentary angle given the length of the adjacent side (run) and the hypotenuse.
Expand All @@ -258,6 +280,7 @@ public static double ComplimentaryAngle_RunHypotenuse(double run, double hypoten
{
return ToDegrees(Math.Asin(run / hypotenuse));
}
public static double BB_bc(double b, double c) => ComplimentaryAngle_RunHypotenuse(b, c);

/// <summary>
/// Converts an angle from degrees to radians.
Expand Down
23 changes: 23 additions & 0 deletions src/SohCahToa/TrigF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static float Rise_RunPrimaryAngle(float run, float primaryAngle)
{
return run * MathF.Tan(ToRadians(primaryAngle));
}
public static float a_bAA(float b, float AA) => Rise_RunPrimaryAngle(b, AA);

/// <summary>
/// Calculates the length of the side opposite to the primary angle (rise) given the length of the hypotenuse and the primary angle in degrees.
Expand All @@ -31,6 +32,7 @@ public static float Rise_HypotenusePrimaryAngle(float hypotenuse, float primaryA
{
return hypotenuse * MathF.Sin(ToRadians(primaryAngle));
}
public static float a_cAA(float c, float AA) => Rise_HypotenusePrimaryAngle(c, AA);

/// <summary>
/// Calculates the length of the side opposite to the complimentary angle (rise) given the length of the side adjacent to the complimentary angle (run) and the complimentary angle in degrees.
Expand All @@ -42,6 +44,7 @@ public static float Rise_RunComplimentaryAngle(float run, float complimentaryAng
{
return run / MathF.Tan(ToRadians(complimentaryAngle));
}
public static float a_bBB(float b, float BB) => Rise_RunComplimentaryAngle(b, BB);

/// <summary>
/// Calculates the length of the side opposite to the complimentary angle (rise) given the length of the hypotenuse and the complimentary angle in degrees.
Expand All @@ -53,6 +56,7 @@ public static float Rise_HypotenuseComplimentaryAngle(float hypotenuse, float co
{
return hypotenuse * MathF.Cos(ToRadians(complimentaryAngle));
}
public static float a_cBB(float c, float BB) => Rise_HypotenuseComplimentaryAngle(c, BB);

/// <summary>
/// Calculates the length of the side opposite to the primary angle (rise) given the length of the side adjacent to the primary angle (run) and the length of the hypotenuse.
Expand All @@ -64,6 +68,7 @@ public static float Rise_RunHypotenuse(float run, float hypotenuse)
{
return MathF.Sqrt(MathF.Pow(hypotenuse, 2) - MathF.Pow(run, 2));
}
public static float a_bc(float b, float c) => Rise_RunHypotenuse(b, c);

/// <summary>
/// Calculates the length of the side adjacent to the primary angle (run) given the length of the side opposite to the primary angle (rise) and the primary angle in degrees.
Expand All @@ -75,6 +80,7 @@ public static float Run_RisePrimaryAngle(float rise, float primaryAngle)
{
return rise / MathF.Tan(ToRadians(primaryAngle));
}
public static float b_aAA(float a, float AA) => Run_RisePrimaryAngle(a, AA);

/// <summary>
/// Calculates the length of the side adjacent to the primary angle (run) given the length of the hypotenuse and the primary angle in degrees.
Expand All @@ -86,6 +92,7 @@ public static float Run_HypotenusePrimaryAngle(float hypotenuse, float primaryAn
{
return hypotenuse * MathF.Cos(ToRadians(primaryAngle));
}
public static float b_cAA(float c, float AA) => Run_HypotenusePrimaryAngle(c, AA);

/// <summary>
/// Calculates the length of the side adjacent to the complimentary angle (run) given the length of the side opposite to the complimentary angle (rise) and the complimentary angle in degrees.
Expand All @@ -97,6 +104,7 @@ public static float Run_RiseComplimentaryAngle(float rise, float complimentaryAn
{
return rise * MathF.Tan(ToRadians(complimentaryAngle));
}
public static float b_aBB(float a, float BB) => Run_RiseComplimentaryAngle(a, BB);

/// <summary>
/// Calculates the length of the side adjacent to the complimentary angle (run) given the length of the hypotenuse and the complimentary angle in degrees.
Expand All @@ -108,6 +116,7 @@ public static float Run_HypotenuseComplimentaryAngle(float hypotenuse, float com
{
return hypotenuse * MathF.Sin(ToRadians(complimentaryAngle));
}
public static float b_cBB(float c, float BB) => Run_HypotenuseComplimentaryAngle(c, BB);

/// <summary>
/// Calculates the length of the side adjacent to the primary angle (run) given the length of the side opposite to the primary angle (rise) and the length of the hypotenuse.
Expand All @@ -119,6 +128,7 @@ public static float Run_RiseHypotenuse(float rise, float hypotenuse)
{
return MathF.Sqrt(MathF.Pow(hypotenuse, 2) - MathF.Pow(rise, 2));
}
public static float b_ac(float a, float c) => Run_RiseHypotenuse(a, c);

/// <summary>
/// Calculates the length of the hypotenuse given the length of the side opposite to the primary angle (rise) and the primary angle in degrees.
Expand All @@ -130,6 +140,7 @@ public static float Hypotenuse_RisePrimaryAngle(float rise, float primaryAngle)
{
return rise / MathF.Sin(ToRadians(primaryAngle));
}
public static float c_aAA(float a, float AA) => Hypotenuse_RisePrimaryAngle(a, AA);

/// <summary>
/// Calculates the length of the hypotenuse given the length of the side adjacent to the primary angle (run) and the primary angle in degrees.
Expand All @@ -141,6 +152,7 @@ public static float Hypotenuse_RunPrimaryAngle(float run, float primaryAngle)
{
return run / MathF.Cos(ToRadians(primaryAngle));
}
public static float c_bAA(float b, float AA) => Hypotenuse_RunPrimaryAngle(b, AA);

/// <summary>
/// Calculates the length of the hypotenuse given the length of the side opposite to the complimentary angle (rise) and the complimentary angle in degrees.
Expand All @@ -152,6 +164,7 @@ public static float Hypotenuse_RiseComplimentaryAngle(float rise, float complime
{
return rise / MathF.Cos(ToRadians(complimentaryAngle));
}
public static float c_aBB(float a, float BB) => Hypotenuse_RiseComplimentaryAngle(a, BB);

/// <summary>
/// Calculates the length of the hypotenuse given the length of the side adjacent to the complimentary angle (run) and the complimentary angle in degrees.
Expand All @@ -163,6 +176,7 @@ public static float Hypotenuse_RunComplimentaryAngle(float run, float compliment
{
return run / MathF.Sin(ToRadians(complimentaryAngle));
}
public static float c_bBB(float b, float BB) => Hypotenuse_RunComplimentaryAngle(b, BB);

/// <summary>
/// Calculates the length of the hypotenuse given the lengths of the other two sides (rise and run).
Expand All @@ -174,6 +188,7 @@ public static float Hypotenuse_RiseRun(float rise, float run)
{
return MathF.Sqrt(MathF.Pow(rise, 2) + MathF.Pow(run, 2));
}
public static float c_ab(float a, float b) => Hypotenuse_RiseRun(a, b);

/// <summary>
/// Calculates the primary angle in degrees given the complimentary angle in degrees.
Expand All @@ -184,6 +199,7 @@ public static float PrimaryAngle_ComplimentaryAngle(float complimentaryAngle)
{
return 90 - complimentaryAngle;
}
public static float AA_BB(float BB) => PrimaryAngle_ComplimentaryAngle(BB);

/// <summary>
/// Calculates the primary angle in degrees given the lengths of the opposite side (rise) and the adjacent side (run).
Expand All @@ -195,6 +211,7 @@ public static float PrimaryAngle_RiseRun(float rise, float run)
{
return ToDegrees(MathF.Atan(rise / run));
}
public static float AA_ab(float a, float b) => PrimaryAngle_RiseRun(a, b);

/// <summary>
/// Calculates the primary angle in degrees given the length of the opposite side (rise) and the hypotenuse.
Expand All @@ -206,6 +223,7 @@ public static float PrimaryAngle_RiseHypotenuse(float rise, float hypotenuse)
{
return ToDegrees(MathF.Asin(rise / hypotenuse));
}
public static float AA_ac(float a, float c) => PrimaryAngle_RiseHypotenuse(a, c);

/// <summary>
/// Calculates the primary angle in degrees given the length of the adjacent side (run) and the hypotenuse.
Expand All @@ -217,6 +235,7 @@ public static float PrimaryAngle_RunHypotenuse(float run, float hypotenuse)
{
return ToDegrees(MathF.Acos(run / hypotenuse));
}
public static float AA_bc(float b, float c) => PrimaryAngle_RunHypotenuse(b, c);

/// <summary>
/// Calculates the complimentary angle in degrees given the primary angle in degrees.
Expand All @@ -227,6 +246,7 @@ public static float ComplimentaryAngle_PrimaryAngle(float primaryAngle)
{
return 90 - primaryAngle;
}
public static float BB_AA(float AA) => ComplimentaryAngle_PrimaryAngle(AA);

/// <summary>
/// Calculates the complimentary angle in degrees given the lengths of the opposite side (rise) and the adjacent side (run).
Expand All @@ -238,6 +258,7 @@ public static float ComplimentaryAngle_RiseRun(float rise, float run)
{
return ToDegrees(MathF.Atan(run / rise));
}
public static float BB_ab(float a, float b) => ComplimentaryAngle_RiseRun(a, b);

/// <summary>
/// Calculates the complimentary angle in degrees given the length of the opposite side (rise) and the hypotenuse.
Expand All @@ -249,6 +270,7 @@ public static float ComplimentaryAngle_RiseHypotenuse(float rise, float hypotenu
{
return ToDegrees(MathF.Acos(rise / hypotenuse));
}
public static float BB_ac(float a, float c) => ComplimentaryAngle_RiseHypotenuse(a, c);

/// <summary>
/// Calculates the complimentary angle in degrees given the length of the adjacent side (run) and the hypotenuse.
Expand All @@ -260,6 +282,7 @@ public static float ComplimentaryAngle_RunHypotenuse(float run, float hypotenuse
{
return ToDegrees(MathF.Asin(run / hypotenuse));
}
public static float BB_bc(float b, float c) => ComplimentaryAngle_RunHypotenuse(b, c);

/// <summary>
/// Converts an angle from degrees to radians.
Expand Down

0 comments on commit fd82f33

Please sign in to comment.