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! =)

Recommended Answers

All 2 Replies

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 .

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.