[comp.graphics] Crookedness of space-curves

peterf@kuling.UUCP (06/06/87)

I have a problem that I would be very glad if someone could help me with:

Given a set of points in space (p1, p2,...,pn) that define a curve in 
space - is there any way of finding out how 'crooked' that curve is?

What I want is some sort of 'coefficient of crookedness' that tells me what
order I should use in a curve-drawing algorithm. The more crooked the
curve is - the higher order of the algorithm has to be used to approximate
the curve. The reason to keep the order down is that it becomes *very*
slow with high orders.


Idea: I was thinking of going through the set and for every curvesegment
defined by three points I'd solve the least-square problem,
Ax*x + Bx + C =0. Then A and B (with proper weights) would tell me how
bent all these little curvesegments are. If I add it up and divide with
the number of segments I'd have something that look like a coefficient.

If anyone has any ideas that they wish to share I'd appreciate it if you
send them to me by E-mail. To thoose of you who are also interested I'd
be glad to summarize, just mail me a note. Thanks.

-- 
==============================================================================
Peter Fagerberg             UUCP: {seismo,enea,mcvax,decwrl,...}!kuling!peterf
Applied Computer Science    ARPA: kuling!peterf@sismo.css.gov
Uppsala University          Analog: +0046 18-128286 or 8-102927

strgh@daisy.warwick.ac.uk (J E H Shaw) (06/24/87)

<for crooked line-eater>

(Tried to e-mail the following response to `coeff. of crookedness' question,
but it just bounced back.)

There were a couple of articles by McConalogue in the Computer Journal
1970 & 1971 that may be helpful (I don't have them to hand).  However,
it's seldom necessary to go beyond a cubic spline (or a more sophisticated
low-order spline if the `curve' is rather angular - see, e.g. R.J.Renka,
`Interpolatory tension splines with automatic selection of tension factors',
SIAM J. Sci. Statist. Comput. 8:393-415 + references therein).

If points are (x1,y1,z1,...), (x2,y2,z2,...), ..., I would just let
ti = sqrt((xi+1 - xi)^2 + (yi+1 - yi)^2 + (zi+1 - zi)^2 + ...),
Ti = sum_from_1_to_i-1 of ti, and fit splines independently to
(ti,xi;i=1,2...), (ti,yi;i=1,2...), (ti,zi;i=1,2...) ...
                                                     ^^^ if in >3 dimensions!
                        -- Ewart Shaw
-- 
J.E.H.Shaw  Department of Statistics, University of Warwick, Coventry CV4 7AL
$$\times\times\qquad\top\gamma\alpha\omega\exists\qquad{\odot\odot\atop\smile}$$