Here you can find the source of cosineTheorem(double d12, double d23, double theta123)
Parameter | Description |
---|---|
theta23 | the angle between d12, d23 in radians. |
public static double cosineTheorem(double d12, double d23, double theta123)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww .j a va 2 s . co m For a planar triangle 1,2,3, computes d13, based on d12,d23 and theta23 = angle(d12,d23) using the cosine theorem, i.e.: d13^2 = d12^2 + d23^2 + d12 d23 cos(theta23) @param theta23 the angle between d12, d23 in radians. @return c^2 (not c !!!!) */ public static double cosineTheorem(double d12, double d23, double theta123) { return (d12 * d12 + d23 * d23 - 2 * d12 * d23 * Math.cos(theta123)); } }