l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
September 2: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2009 Mar 31 22:12

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] [OT] Math question: help me make a rainbow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] [OT] Math question: help me make a rainbow



On Tue, Mar 31, 2009 at 07:21:36PM -0700, Bill Broadley wrote:
> Some.  Not sure what you are getting at though.  You want to draw 180 degrees
> of a circle with the end points defined by p1 and p2?  What if you want to
> make an upside down rainbow?  Or 1/2 of one?

I only want to draw all 180 degress if y1==y2.  Otherwise, it'd be
less of the arc.  (See my ASCII diagrams)


> In any case the center is trivial.  Lets call the center M, so:
> M.x = abs ( p1.x - p2.x ) / 2 + p1.x
> M.y = abs ( p1.y - p2.y ) / 2 + p1.y

Based on my sketches on paper, I know that the center of the circle
is only the midpoint of P1 and P2 when y1==y2.  Otherwise, one of the
points is closer.

Constraint-wise, I think a minimum of a 90 degree arc, and perhaps
a minimum radius (if the user clicks and releases very close to the
same place, which happens when kids don't understand to click/drag/release)
would be useful, too.

-bill!
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.