[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: arcs in 3d?



Hi Andy, 

Thank you very much for your example figure and arc making functions.  I seem to have a problem running your example though.  I'm wondering if I need a newer version of epix. Here are the errors that I get:

jaedlund@darkstar:~/GalacticFigure/EpixTest$ elaps arcs.xp 
/tmp/epix-6038/epix-6038.cc: In function `int main()':
/tmp/epix-6038/epix-6038.cc:45: error: `arrow_fill' undeclared (first use this 
   function)
/tmp/epix-6038/epix-6038.cc:45: error: (Each undeclared identifier is reported 
   only once for each function it appears in.)
/home/jaedlund/local/include/epix.h:2655: error: too many arguments to function 
   `void ePiX::dot(ePiX::P)'
/tmp/epix-6038/epix-6038.cc:49: error: at this point in file
/home/jaedlund/local/include/epix.h:2655: error: too many arguments to function 
   `void ePiX::dot(ePiX::P)'
/tmp/epix-6038/epix-6038.cc:50: error: at this point in file
/home/jaedlund/local/include/epix.h:2655: error: too many arguments to function 
   `void ePiX::dot(ePiX::P)'
/tmp/epix-6038/epix-6038.cc:51: error: at this point in file
/home/jaedlund/local/include/epix.h:2655: error: too many arguments to function 
   `void ePiX::dot(ePiX::P)'
/tmp/epix-6038/epix-6038.cc:52: error: at this point in file
/home/jaedlund/local/include/epix.h:2655: error: too many arguments to function 
   `void ePiX::dot(ePiX::P)'
/tmp/epix-6038/epix-6038.cc:53: error: at this point in file
epix: ERROR: Could not create elaps-6036.eepic
elaps: ERROR: Can't create arcs.eepic


I'm using version 1.0.0

jaedlund@darkstar:~/GalacticFigure/EpixTest$ elaps -v
elaps is part of ePiX, Version 1.0.0

Copyright (C) 2001, 2002, 2003, 2004
Andrew D. Hwang <ahwang@mathcs.holycross.edu>
Department of Mathematics and Computer Science
College of the Holy Cross
Worcester, MA, 01610-2395, USA

  "elaps --verbose -v" for license

Thanks, 

Jeffrey



> Hi Jeffrey,
> 
> Here are (lightly tested:) functions that
> 
> * draw the smaller arc between two arrows in the plane spanned by the
>   arrows, assuming the arrows have the same length,
> 
> * return a point along said arc, with t=0 corresponding to the first point
>   and t=1 to the second.
> 
> ---(snip)---
> // arc joining arrow(center, arg1) and arrow(center, arg2)
> void arc_span(P center, P arg1, P arg2)
> {
> 	// construct orthogonal basis of plane spanned
> 	P v1=arg1-center, v2=arg2-center; // direction vectors
> 	P perp1 = v2%v1;                  // orthogonalize
> 	perp1 *= 1/norm(perp1);           // OK if arrows not parallel
> 
> 	double norm1=norm(v1);
> 	double norm2=norm(v2);
> 
> 	double theta=Acos((v1|v2)/(norm1*norm2));
> 
> 	ellipse(center, v1, norm1*perp1, 0, theta);
> }
> 
> // generalized midpoint of arc: t=0 <-> arg1, t=1 <-> arg2
> P arc_point(P center, P arg1, P arg2, double t=0.5)
> {
> 	P v1=arg1-center, v2=arg2-center;
> 	P perp1 = v2%v1;
> 	perp1 *= 1/norm(perp1);
> 
> 	double norm1=norm(v1);
> 	double norm2=norm(v2);
> 
> 	double theta=t*Acos((v1|v2)/(norm1*norm2));
> 
>   return center+ Cos(theta)*v1 + (Sin(theta)*norm1)*perp1;
> }
> 
> ---(snip)---
> The attached file is a complete figure.
> 
> > Another simple question:  If I have a P point, how to I access the
> > members of the triple?  i.e. something like point.x point.y point.z?
> >
> point.x1(), etc. :)
> 
> Best, Andy
> 
> Andrew D. Hwang			ahwang@mathcs.holycross.edu
> Department of Math and CS	http://math.holycross.edu/~ahwang
> College of the Holy Cross	(508) 793-2458 (Office: 320 Swords)
> Worcester, MA, 01610-2395	(508) 793-3530 (fax)
> 
>