954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Intersects Arc

Hi everyone. I have a quick question: Is there anyway that you can check to see if a point lays on an Arc2D object? I'm trying to write a Physics library (or at least part of one), and I noticed that there is no method that does it. You can check to see if the point is inside the curve, but that's not what I need. Is there a class that does that kind of math for you, or will I have to figure it out myself. Which brings me to: Can you retrieve an Array the points that are on an Arc?

Any help in this matter would be greatly appreciated! =)

llemes4011
Posting Whiz in Training
224 posts since Aug 2008
Reputation Points: 41
Solved Threads: 13
 

boolean contains(Point2D p)
--- Tests if a specified Point2D is inside the boundary of the Shape.

It is a method of java.awt.geom.RectangularShape , which is super class of Arc2D .

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Thank you for your reply. I took that in as meaning "If the point at x,y is within the bounds of the rectangle, this method returns true, else returns false." I'll do a couple tests real quick.

Also. I did some googling and found another "solution". I found an article on Bezier Curves, and made an array that stores the points that are calculated for the curve, and I think that should work too. Also, Bezier Curves are REALLY cool lol.

EDIT: The attachment shows my results of using the .contains method. It doesn't work =S

Attachments on_arc_false.JPG 13.7KB
llemes4011
Posting Whiz in Training
224 posts since Aug 2008
Reputation Points: 41
Solved Threads: 13
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: