Help with JSUI coordinates and defining a circular area for onclick
Dec 26, 2009 at 7:39pm
Help with JSUI coordinates and defining a circular area for onclickHi. I was wondering if anyone here could help me find a solution to my problem. I have created 12 framed circles, each embedded within the other. The smallest being 0.1 and the largest having a radius of 1.0. Creating 12 rings. I am trying to work it out so that when I click within the bounds of one of these rings it will fill. I am having difficulty translating the screentoworld Cartesian coordinates(1. to 1.) into an area that has an arc for a boundry. How does one define an area that has an arc? 

Dec 27, 2009 at 11:00am
if i get you right, you might like to look at pythagoras’ theorem to calculate the distance of the click location to the origin of the circle(s) you want to test. if the distance is smaller than the radius, then you are inside the circle. i’ve been doing something similar recently, so here goes a little example
hth, 

Dec 27, 2009 at 7:34pm
Hi. Thanks for the response! I had been trying to get it working using this cartopol conversion, but it doesn’t seem to return the same values as it does when sending the variables through a Cartopol object which returns the more solid results. var radius = Math.sqrt(real^2+imag^2); After much fiddling, my solution was to just script a cartopol and send the variables through it and the results back into JSUI upon onclick, and have it delete the object right after the event. It works well, but I wasn’t completely happy with the solution as I knew that there was a way to process the variables without leaving JSUI. I will have a look at your code example soon!! thank you so much for the help!! Much appreciated! 
You must be logged in to reply to this topic.