Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Calculates the angle A given length a and circle radius r, according to
     * the law of sines ([a/sin(A) = 2R], thus [A = arcsin(a/2r)])
     * 
     * @param a
     * @param r
     * @return angle A in radians
     */
    public static float calcAngle(float a, float r) {
        return (float) Math.asin(a / (2 * r));
    }
}