I'd somehow want to generate n such consecutive points. Any ideas?
I've called that starting point (x0,y0) instead, below.
> How to find the next point (xk,yk) such that the distance between
> the two points is of length k.
>
> I'd somehow want to generate n such consecutive points. Any ideas?
It makes a huge difference whether the distance between the two points is
to be measured along a straight line, as one would normally do, or along
the parabola itself.
In the former case (straight-line distance), your task can be done
algebraically, but it is tedious. The equation for the circle with center
(x0,y0) and radius k is
(x - x0)^2 + (y - y0)^2 = k^2 [*]
Solving the system of two equations, y = 4ax^2 and [*], for x and y
requires solving a quartic equation. But that would give your (xk,yk).
In the latter case (distance along the parabola), matters are even worse.
The arc length from the vertex to the point (x, 4ax^2) is given by
1/2 x sqrt(1 + (8ax)^2) + asinh(8ax)/(16a)
where asinh denotes the inverse hyperbolic sine. Thus, to find the points
having arc length k from the vertex, one would need to solve
1/2 x sqrt(1 + (8ax)^2) + asinh(8ax)/(16a) = k
for x. Unfortunately, that surely cannot be done in closed form in terms of
familiar functions.
David
I am looking at how to generate the next point from the previous point. If this was possible I would be somewhat able to plot smooth curves on my computer.
--deostroll
But for your purposes, isn't this kind of solution overkill? If you are trying to play with raster graphics, a calculation pixel by pixel is better because it frees you from deciding the best distance between points, and if a vector graphics system, no matter the distance you choose, there are always a zoom which will turn it bad... unless you recalculate, in which case, you fall in the logic of the raster graphics. To keep the original spirit, did you considered using numerical methods? 2 or 3 iterations of a Newton–Raphson method, would probably produce the same practical results with less CPU cost than the exact solution.
Hi,
Since the particular equation you give is for a parabola with its vertex at
the origin, the only time you will satisfy your requirements that a second
point be defined as (kx, ky), given a first point (x,y) is when (x,y) =
(0,0). Your requirement, assuming that k is a constant, real number, works
only with lines, or symmetrical objects whereby your (x1,y1) is on the axis
of symmetry, which coincides with the y-axis. However, if you just require
the second point to be located at a distance of k from the first point, than
this is easy to do.
Let the first given point be (x1, y1), and the second point defined as (x,y)
at a distance of k from (x1, y1), and satisfy the equation y = 4ax^2. This
would also allow the first coordinates to be expressed as (x1, 4a(x1)^2).
Please note that I'm taking liberty of using x1 and y1 to represent single
variables, rather than meaning "x times 1".
k^2 = (x - x1)^2 + (y - y1)^2
(y - y1)^2 = k^2 - (x - x1)^2
y - y1 = +/- [k^2 - (x - x1)^2]^(1/2)
y = y1 +/-[k^2 - (x -x1)^2]^(1/2)
Substituting y1 with 4a(x1)^2 :
y = 4a(x1)^2 +/- [k^2 - (x - x1)^2] ^ (1/2)
This should give you the other points that are at a distance of k from the
original coordinates of (x1, y1). To confirm that you won't find other
points (kx, ky) from (x1, y1), other than using the origin for your first
set, can be done by setting y = 4ax^2 in this ending equation, as well as x
= k(x1), which means x/x1 = k, and trying to reduce the equation to show
whether or not there is truly an equality using:
y = 4ax^2 ?=? 4a(x1)^2 +/- [k^2 - (x - x1)^2] ^ (1/2)
If anyone has the fortitude to continue with this to see if you can reduce
it to show that x2 = k (x1), I offer my best. I'm sure that this will only
work for the trivial case where (x1, y1) = (0,0).
Convenient to use parametric form of parabola .(x,y) = T = a ( 2t,
t^2). Slope at any point is simply t. I suggest using the form 4a y
=x^2, where a is focal length, In maths too you should also track the
physical dimensions.
If the given point is T1 = a ( 2t1, t1^2) , and required point is T2 =
a ( 2 t2, t2^2) . (L/a)^2 = ( 2 t2 - 2 t1)^2 + (t2^2 - t1^2)^2, an
unavoidable 4th order polynomial. Pl check the calculation once, my
late night posting ;)