Пример #1
0
        public Vector3 GetHighestPoint()
        {
            var d = (C.y - A.y) / parabola2D.Length;
            var e = A.y - C.y;

            var parabolaCompl = new Parabola2D(parabola2D.A, parabola2D.B + d, parabola2D.C + e, parabola2D.Length);

            Vector3 E = new Vector3();

            E.y = parabolaCompl.E.y;
            E.x = A.x + (C.x - A.x) * (parabolaCompl.E.x / parabolaCompl.Length);
            E.z = A.z + (C.z - A.z) * (parabolaCompl.E.x / parabolaCompl.Length);

            return(E);
        }
Пример #2
0
        private void refreshCurveClose()
        {
            //distance to x0 - x2 line = |(x1-x0)x(x1-x2)|/|x2-x0|
            var fac01 = (A.y <= B.y) ? 1f : -1f;
            var fac02 = (A.y <= C.y) ? 1f : -1f;

            Vector2 A2d, B2d, C2d;

            //get A=(x1,y1) B=(x2,y2) C=(x3,y3)
            A2d.x = 0f;
            A2d.y = 0f;

            //b = sqrt(c²-a²)
            B2d.x = 1f;
            B2d.y = Vector3.Distance((A + C) / 2f, B) * fac01;

            C2d.x = 2f;
            C2d.y = Vector3.Distance(A, C) * fac02;

            parabola2D = new Parabola2D(A2d, B2d, C2d);
            h          = Vector3.up;
        }
Пример #3
0
 public void DrawParabola(Parabola2D parabola, Brush brush = null)
 {
     // Find intersection of parabola with 4 edges of viewing region.
     //var topIntersections = parabola.FindIntersection(
 }