LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 492 users online 173438 members 945 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Video | Dictionary | News | FAQ
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
4 online / 34 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Java/Geometry: Regular Polygon Help
more math than programming
Replies: 5Last Post Jan. 15 11:31am by Whuppee
Single page for this topic Email Print Favorite
( ranman )


Connoisseur

Patron
Reply
I don't really need help with the Java part but I barely remember geometry...

Given "int n" number of sides of "double s" length.
(that's an integer number of sides, and all real numbers for side length)


how can I:

calculate r and R? and from that calculate area?
Code:

public double getVertexAngle(); // gets the inner angle of each vertice

public double getR() //calculates radius
public double getr() //calculates apothem

Ty for any help and just pm me or post here if something doesn't make since and I'll try to explain it better.

Post edited at 3:03 pm on Jan. 6, 2008 by ranman

-------
If you need any help with any language
especially French, English, or German, let me know...


3:02 pm on Jan. 6, 2008 | Joined June 2006 | 329 Days Active
Join to learn more about ranman Hawaii, United States | Straight Male | 1890 Posts | 6925 Points
( ranman )


Connoisseur

Patron
Reply
This is why I love livewire... perfectly nice questions are totally ignored... spam topics just roll right off and people love it... so much for support.

-------
If you need any help with any language
especially French, English, or German, let me know...


10:02 pm on Jan. 8, 2008 | Joined June 2006 | 329 Days Active
Join to learn more about ranman Hawaii, United States | Straight Male | 1890 Posts | 6925 Points
Whuppee


Dairy Product Addict

Ad Free
Reply
Actually, perfectly nice questions that I have either answers or the inclination to work out answers for are jumped on pretty quickly.  I didn't in regard to this topic as I barely remember geometry either.

And I tend to avoid serious topics in which I have nothing meaningful to contribute.


I feel you, though.

It's rare to see a meaningful topic go unspammed by the fresh topic point whores.


I'm actually going to take a shot at solving this.  Any chance you have an example or two for me to check my work against?

You know, for some number of sides n of length s, what would r and R work out to be?

Minimum number of sides?  I'm assuming three.

-------
Unbelievably awesomesauce to the absurd degree that I wet myself.
Who else has created a LW/magnets
so explicit the mods deleted a screencap of it? =P


12:57 am on Jan. 9, 2008 | Joined May 2002 | 361 Days Active
Join to learn more about Whuppee Oregon, United States | Lesbian Male | 1510 Posts | 7131 Points
( ranman )


Connoisseur

Patron
Reply


those work?

-------
If you need any help with any language
especially French, English, or German, let me know...


3:05 am on Jan. 11, 2008 | Joined June 2006 | 329 Days Active
Join to learn more about ranman Hawaii, United States | Straight Male | 1890 Posts | 6925 Points
Whuppee


Dairy Product Addict

Ad Free
Reply
Definately.

Let's just hope I'll be able to do something with them =P

-------
Unbelievably awesomesauce to the absurd degree that I wet myself.
Who else has created a LW/magnets
so explicit the mods deleted a screencap of it? =P


11:25 pm on Jan. 11, 2008 | Joined May 2002 | 361 Days Active
Join to learn more about Whuppee Oregon, United States | Lesbian Male | 1510 Posts | 7131 Points
Whuppee


Dairy Product Addict

Ad Free
Reply
Where r is your apothem, R is your radius, n is your number of sides, and s is the length of each side...


Solving for r:

    r= s / ( 2 * tan(pi / n) )

    or

    r= R * cos(pi / n)


Solving for R

    R= s / ( 2 * sin(pi / n) )

    or

    R= r / cos(pi / n)


Area is:

    Area= 0.5 * (r * perimeter)

Can't claim to have picked up on any idea of how any of that works =P

Yay for having completely forgotten geometry?

-------
Unbelievably awesomesauce to the absurd degree that I wet myself.
Who else has created a LW/magnets
so explicit the mods deleted a screencap of it? =P


11:31 am on Jan. 15, 2008 | Joined May 2002 | 361 Days Active
Join to learn more about Whuppee Oregon, United States | Lesbian Male | 1510 Posts | 7131 Points
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic