/// <summary> /// Gets a side from the opposite angle and the length of the opposite side. /// </summary> /// <param name="oppositeAngle">Angle opposite the side to calculate in degrees.</param> /// <param name="oppositeSide">Length of the opposite side.</param> public static decimal GetSideFromOppAngleOppSide(decimal oppositeAngle, decimal oppositeSide) { // tan(oppositeAngle) = x / oppositeSide // x = oppositeSide * tan(oppositeAngle) return(oppositeSide * Convert.ToDecimal(DecimalEx.Tan(DecimalEx.ToRad(oppositeAngle)))); }
/// <summary> /// Gets a side from the adjacent angle and the length of the opposite side. /// </summary> /// <param name="adjacentAngle">Angle adjacent to the side to calculate in degrees.</param> /// <param name="oppositeSide">Length of the opposite side.</param> public static decimal GetSideFromAdjAngleOppSide(decimal adjacentAngle, decimal oppositeSide) { // tan(adjacentAngle) = oppositeSide / x // x = oppositeSide / tan(adjacentAngle) return(oppositeSide / Convert.ToDecimal(DecimalEx.Tan(DecimalEx.ToRad(adjacentAngle)))); }