[metapost] Drawing 3d spherical arcs
Dan T. Abell
dabell at bikerider.com
Thu Dec 1 01:09:31 CET 2011
Dear Camm,
Have a look at Denis Roegel's TugBoat article "Spheres,
great circles and parallels".
http://www.tug.org/TUGboat/tb30-1/tb94roegel-spheres.pdf
Cheers,
-Dan
On 30 Nov 2011, at 08:21, Camm Maguire wrote:
> Greetings! I'm trying to draw (great circle) arcs on a sphere with
> proper perspective. I do all the manipulations in 3d color vectors, and
> then draw the projections onto a pair taking out the line of sight.
>
> The basic command I have is
>
> draw pp(-nq){pp(-nq+m)-pp(-nq-m)}
> ..tension ten..pp(e){pp(e+ep)-pp(e-ep)} dashed withdots withcolor c;
> draw pp(e){pp(e+ep)-pp(e-ep)}
> ..tension ten..pp(m){pp(m+nq)-pp(m-nq)}
> ..tension tenn..pp(ep){pp(ep-e)-pp(ep+e)}
> ..tension tennn..pp(nq){pp(nq-m)-pp(nq+m)} withcolor c;
>
> Here pp is the projection macro, nq is the intersection of the arc with
> the equator, e is the arc intersection with the visible edge of the
> sphere, m is the point of northernmost latitude, and ep is the point of
> the arc orthogonal to e. So the basic strategy is to specify the
> tangent at each point using the orthogonal vector in 3d.
>
> This works, but the default tension parameter can result in visible
> distortion. So I've fudged it with by hand tweaked variables ten, tenn,
> and tennn.
>
> I'd like to compute these (or equivalent) within metapost. As the curve
> is mathematically well defined, it seems as though the faithful drawing
> should have a unique metapost representation.
>
> Suggestions?
>
> Take care,
> --
> Camm Maguire camm at maguirefamily.org
> ==========================================================================
> "The earth is but one country, and mankind its citizens." -- Baha'u'llah
> --
> http://tug.org/metapost/
More information about the metapost
mailing list