If you use symmetry only about half of the points are needed. $5$ points for the image above with $4$ segments. This would only need in advance calculation and storage of the segement end points, e.g. $ = $ and then do the interpolation on that segment. So first step would be to look at $t$ and determine which interval applies e.g. using symmetry and a lookup table for $\cos$ for the first $1/8$th of the circle might fail due to having not much memory etc.Īnother approach would be to approximate the circle by a polygon:Īssign each line segment a parameter interval $$. We would need more information on them, to give useful advice. If you have restrictions on using trigonometric functions and their inverses, then you probably have more restrictions (maybe even no floating point arithmethic). So your real problem is to approximate the above functions. The first is calculated via $\arctan(x)$ the second via $\cos(x)$ and $\sin(x)$ or one of them replaced by the square root function. This routine draws a 3d line right on top of your 3dpoly. I use this one to do basically just what you're talking about. Thanks I have a few custom routines I've written to fill in the gaps in LDD. $\phi_a$ and $\phi_b$ from $(x_a, y_a)$ and $(x_b, y_b)$, and then Does anyone know of a way to insert a point or identify spots along the polyline when the elevation sits at an even number such as 401,402,etc. The problem is that you would need to calculate: If the shortest path is wanted, one needs to modify the above. Which could involve segments of length more than $\pi$. Since a linear interpolation is the interpolation between two values in a straight line, we can do this for the x and y independently to get the new point.The interpolation you want is a linear interpolation of the angle (which is identical to the arclength for the unit circle): If we have a single line segment of two points, we want to do a linear interpolation (or “lerp”) between them. The Simple Case: Interpolate on a Line Segment If we do want to use a ratio, the distance we require is also easily computed. (If we don’t, this can be computed easily.) We will also assume that the point we want to find is a specific distance along the linestring and not a ratio from. For this problem, we will assume we know the length. The length of the linestring is the sum of the lengths of all its segments. To interpolate along a linestring is, effectively, to walk along the linestring until we get to the point we want. Thus the sequence can be thought of as string of line segments that define some curve. A linestring is simply a sequence of two or more points (or zero points), where each pair of points defines a line segment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |