Exemple #1
0
    public Range <float> TriPyramidEdgeRange(float a, float b, float c, float d, float e)
    {
        float h_bc = TriangleTall(b, c, a);
        float h_de = TriangleTall(d, e, a);

        Debug.Log("h_bc = " + h_bc + "  h_de = " + h_de);

        float l_bc = Math.AboutEquals(b * b, h_bc * h_bc) ? 0 : Mathf.Sqrt(b * b - h_bc * h_bc);
        float l_de = Math.AboutEquals(d * d, h_de * h_de) ? 0 : Mathf.Sqrt(d * d - h_de * h_de);

        Debug.Log("???: " + (d * d - h_de * h_de));
        float l = Mathf.Abs(l_bc - l_de);

        Debug.Log("l_bc = " + l_bc + "  l_de = " + l_de);
        Debug.Log("l = " + l);

        float h_min = Mathf.Abs(h_bc - h_de);
        float h_max = h_bc + h_de;

        Debug.Log("h_min = " + h_min + "  h_max = " + h_max);

        float min = Mathf.Sqrt(l * l + h_min * h_min);
        float max = Mathf.Sqrt(l * l + h_max * h_max);

        return(new Range <float>(min, max));
    }