posted 10 years ago

Write a program in Java that calculates the cartesian coordinates of a N sided polygon with side length D. ( Input Integral Values for N & D ).....................

if any one have any idea about this.please help me???

if any one have any idea about this.please help me???

posted 10 years ago

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, that sounds like homework that you should be doing. We can help you with the Java implementation if you get stuck, but the basic ideas need to come from you. Have you had any thoughts on how to go about it?

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, that sounds like homework that you should be doing. We can help you with the Java implementation if you get stuck, but the basic ideas need to come from you. Have you had any thoughts on how to go about it?

posted 10 years ago

Geometry 101. If all sides of a polygon are the same size, then the angles at each vertex is the same. Given the number of sides, you can easily find the angle at the vertex. With a length of a side and angle at the vertex, and one point of the polygon, you can find the next point of the polygon, and so on, til you get the original point.

Henry

Originally posted by champ vicky:

if any one have any idea about this.please help me???

Geometry 101. If all sides of a polygon are the same size, then the angles at each vertex is the same. Given the number of sides, you can easily find the angle at the vertex. With a length of a side and angle at the vertex, and one point of the polygon, you can find the next point of the polygon, and so on, til you get the original point.

Henry