Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static Map<Double, Double> findAngles(double a, double b, double c) {
        Map<Double, Double> sideToAngleMap = new HashMap<Double, Double>();

        sideToAngleMap.put(a, Math.toDegrees(Math.acos((b * b + c * c - a * a) / (2 * b * c))));
        sideToAngleMap.put(b, Math.toDegrees(Math.acos((a * a + c * c - b * b) / (2 * a * c))));
        sideToAngleMap.put(c, 180 - sideToAngleMap.get(a) - sideToAngleMap.get(b));

        return sideToAngleMap;
    }
}