cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Programming check: Point in Circle

Snowshoe_Bob
12-Amethyst

Programming check: Point in Circle

I'm trying to get a programmed text output from testing if a point is inside a circle.  All of the points are either secondary ohms or degrees.  The chuck of programming seems to fail if there are units attached to the numbers.  See Below.

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

Thank you!  That worked.

 

I attached the file along with the screen shot in the first, original post.  This site must have deleted the program file.  File attached now.

View solution in original post

11 REPLIES 11


All of the points are either secondary ohms or degrees. 

 


?????

 

 


See Below.

 


Nothing to see !?

Hello Werner,

 

Because maybe the units of Secondary Impedance and degrees, the chunk of programming to decide if a point is inside or outside a circle fails.  See attached.

Its hard to debug a picture - especially as you don't show the variables you use when calling the function and you don't show the error message which is thrown ...

Always attach the file (stripped down to the essentials) if ever possible and not just a picture!

 

Best guess i that the 10^-10 must be assigned the very same unit as the other variables!
If you don't need to know if a point is (approximately) at the circumfence of the circle, you can omit that part and simple distinguish between <= (inside) and > (outside).

Thank you!  That worked.

 

I attached the file along with the screen shot in the first, original post.  This site must have deleted the program file.  File attached now.

ttokoro
20-Turquoise
(To:Snowshoe_Bob)

Deleate NaN NaN if you add ohm unit for the other data.

image.png

I'm a new user.  How should I apply the above?

Werner_E
25-Diamond I
(To:ttokoro)


@ttokoro wrote:

Deleate NaN NaN if you add ohm unit for the other data.

image.png


???
Guess this reply does not belong to the current question but to the other thread of @Snowshoe_Bob 

ttokoro
20-Turquoise
(To:Snowshoe_Bob)

Check many points.

image.pngimage.pngimage.pngimage.pngimage.png

What you posted is pretty amazing.  I'll weed through it tomorrow.  Thank You!

 

So for now, the finished product is attached.  As I get more skilled, I can enhance the program.

ttokoro
20-Turquoise
(To:Snowshoe_Bob)

stack needs [NaN NaN] or first row data with same cols. But if you do not need [NaN NaN], serect the data using submatrix functoin. 

However, it can also do as follows. 

Prime plot with each area color also here.

image.pngimage.png

image.png

O.K. Thank you. I'll give that a try.

Announcements

Top Tags