Java cos cosineTheorem(double d12, double d23, double theta123)

Here you can find the source of cosineTheorem(double d12, double d23, double theta123)

Description

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)

License

Open Source License

Parameter

Parameter Description
theta23 the angle between d12, d23 in radians.

Return

c^2 (not c !!!!)

Declaration

public static double cosineTheorem(double d12, double d23, double theta123) 

Method Source Code

//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));
    }
}

Related

  1. cosDeg(double degrees)
  2. cosf(float f)
  3. cosf(float value)
  4. cosineCoefficient(double[] hist1, double[] hist2)
  5. cosineInterpolate(float y1, float y2, float mu)
  6. cosInt(double s)