cotangent java code example
Example: cotangent in java
strictfp class TrigFun {
public static void main(String[] args) {
double rads, degs, tanA, coTanA;
degs = 120d;
rads = Math.toRadians(degs);
tanA = Math.tan(rads);
System.out.println("Tangent = " + tanA);
coTanA = 1.0 / Math.tan(rads);
System.out.println("Cotangent = " + coTanA);
rads = Math.atan(tanA);
degs = Math.toDegrees(rads);
System.out.println("Arc tangent: " + degs);
rads = Math.atan(1 / coTanA);
degs = Math.toDegrees(rads);
System.out.println("Arc cotangent: " + degs);
}
}