# To get the points on the perimeter of a Rounded Rectangle

• 06-11-2008, 02:50 PM
rashibahal
To get the points on the perimeter of a Rounded Rectangle
Hi all
For some requirement in my project i have made a Rounded Rectangle. Now i want to know how can i calculate to get the points on the perimeter of that rounded rectangle.
I also have a point of reference which will be helpful to get the perimeter points.
Plz help me as its very urgent.

• 06-11-2008, 04:16 PM
Nicholas Jordan
How did you accomplish the Rectangle? That should have the data for the rectangle already.
• 06-12-2008, 07:29 AM
rashibahal
No it does not provide the data to calculate the perimeter. I want to know if some algo or code is available for this. I am using it in a method which does not provide any of the helpful functions. I have to calculate it myself.
• 06-12-2008, 07:38 AM
Eranga
Jordan says that, to draw a rectangle you need data, basically coordinates. You say that you don't have those?
• 06-12-2008, 07:42 AM
rashibahal
Ok, i misunderstood wht he said. I have the bounds of the figure i.e. the rounded rectangle, which gives me the height, width and the location of that rounded rectangle.
• 06-12-2008, 07:52 AM
Eranga
Now you know a fixed location(is that center coordination of the figure?), width and height. Just you want to find the radius of curves, right?

Seems to me you need a simple functionality find the curve length.
• 06-12-2008, 09:14 AM
rashibahal
No, its not so...let me tell u the whole scene.

I have a Rectangle of draw2d.geometry...which is passed in the graphics.drawRoundedRectangle() method...Hence i get a rounded rectangle figure.
Now, in some other class i am using an overriden method... i get the access of that same draw2d's Rectangle which i used to pass in the drawRoundedRectangle()..but in the present class i am using an overriden method and i dnt have the graphics object available.

Now, using that Rectangle...i want to make a method that would get the point exactly on the edge of the rounded rectangle when i would try to connect two such rounded rectangle figures. So, for that purpose i want to know some algo or method that wld get the points on the edge of the rounded rectangle.