Calculating Parabolic Curves in 3D Space Task

Write a program or function that will determine if a point in 3D space lies on a 2D parabolic curve.



Input

3 points in 3D space


vertex of a 2D parabolic curve
arbitrary point on the curve
arbitrary point in space


Input may be taken in any form (string, array, etc.) provided no other data is passed.



You may assume


the axis of a parabola will be parallel to the z axis
the vertex of a parabola has the maximal z value
parabolae will never degenerate
point values will be whole numbers that are ≥ -100 and ≤ 100




Output

A truthy/falsey value representing whether the third point given lies on the parabolic curve of the first two points.



Examples

Input:

(2, 1, 3)
(1, 0, 1)
(4, 3, -5)


Output:

1




Input:

(16, 7, -4)
(-5, 1, -7)
(20, 6, -4)


Output:

0




Walkthrough (Example #1)


Find a third point on the curve. To do this, mirror the arbitrary point (on the curve) over the vertex. Here is a visual (each blue line is √6 units):


Find the parabolic curve between the three. This is easiest on a 2D plane. Here is the 3D graph, translated to a 2D graph (each blue line is √6 units):


Graph the third given point and solve.
Jelly, 13 11 bytes
_÷/µḢ²=A;$P

The input format is a bit strange; it takes P1 as the second argument, and (P3,P2) as the first argument, where each point is expressed in the form ((x+yj),z).
We first normalize the points so that the vertex is on the origin, and then make sure that P1 and P2 are on the same line, and also that the ratio of their z distances is equal to the ratio of their x distances.
_÷/             Helper link. Inputs: (P3,P2) on left, P1 on right.
_                  Subtract right from left. (P3-P1,P2-P1). 
 ÷/                Fold division. (P3-P1)/(P2-P1). P2-P1 is nonzero in both x+yi and z.
   µ               Push the chain onto the stack, and start a new monadic link.
    Ḣ²=A;$P     Hook; main link. Calculates whether w² = a and a is nonnegative.
                Input: The result of the helper link. Call it [w,a].
    Ḣ²              Pop w and square it. Now the list is [a].
       A,$          Concatenate a to its absolute value.
      =             Fork; is w equal to [a,abs(a)]? Returns 2 element list of 0 or 1
          P         Product; that is, true if w was equal to both a and abs(a).

Try it here.