Fredrik,
Speed is not a concern right now as RB appears to have plenty of power for
these relatively simple graphics that I'm doing.
However when everything is working properly a cleanup operation will be done to
speed up execution and/or lessen the
burden on the CPU.
So now I've flagged the mouse in annulus (!), next thing is to measure the
angle....
Fredrik Wahlgren wrote:
> Actually, the suggested solution can be made somewhat faster. You don't
> actually need to calculate sqrt
> Here's an alternative approach:
>
> compute (xm-150)^2 + (ym-150)^2
>
> - if D <= 8100 then InSmallCir = true // 90^2 = 8100 Set a boolean variable
> InSmallCir to
> indicate in the small circle
> if D <= 10000 then InBigCir = true // 100^2 = 10000
> if InBigCir and Not(InSmallCir) then ... you're in the annulus (ring) of
> width 10
>
> If speed is a concern, this will be faster. If it's not, then I suggest you
> stick with GAmoore's reply.
>
> / Fredrik
>
> ----- Original Message -----
> From: <GAmoore at aol dot com>
> To: <gettingstarted at lists dot realsoftware dot com>
> Sent: Wednesday, December 29, 2004 10:05 PM
> Subject: Re: Trigonometry help
>
> > On a canvas, at location 150,150, are two filled concentric circles
> > (360deg ArcShapes),
> >
> Isn't drawoval better to use here?
>
> > the one on the bottom has a radius of 100 and the one on the top has a
> > radius of 90.
> >
> (150,150) is the center for both, right?
>
> > The problem is to identify (set a flag) when the mouse is in the non
> > overlapping area...
> > that is; inside of the bigger circle AND outside of the smaller one.
> >
>
> - grab the mouse position : (xm, ym)
> - compute distance D from center to that point
> distance( xm, ym)
> compute sqrt( (xm-150)^2 + (ym-150)^2)
> - if D <= 90 then InSmallCir = true //set a boolean variable InSmallCir to
> indicate in the small circle
> if D <= 100 then InBigCir = true
> if InBigCir and Not(InSmallCir) then ... you're in the annulus (ring) of
> width 10
>
> I was hoping there would be some need for trig here.
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives of this list here:
> <http://www.realsoftware.com/listarchives/lists.html>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives of this list here:
> <http://www.realsoftware.com/listarchives/lists.html>
--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|