Results 1 to 6 of 6

Thread: Mathematical Restart...

  1. #1

    Thread Starter
    Hyperactive Member DavidHooper's Avatar
    Join Date
    Apr 2001
    Posts
    357

    Mathematical Restart...

    As an easy restart into the ways of the math, here is a quick question. First correct answer (there are more than one) wins.

    The question is:
    "Devise a formula for the area of a regular polygon with the following variables:
    n - number of sides
    l - length of each side"


    The prize is the knowing you're a winner .
    There are 10 types of people in the world - those that understand binary, and those that don't.

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    Easier to develop an algorithm, thinking of the regular polygon as being made of N isosceles triangles.

    Angle = Pi / N, which is half the angle opposite the base of triangle.

    Height = Length / 2*Tan(Angle), which is height of a triangle

    Area = N*Length*Height / 2


    Area = N*length2 / 4*Tan( Pi / N ), if I made the substitutions correctly.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  3. #3
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271
    Area = (L^2 * N) / (4 * Tan(pi / N)) 'radians
    Area = (L^2 * N) / (4 * Tan(180 / N)) 'degrees

    In VB the Tan function expects radians. If N = 0, 1, 2 an error should occur, however, since pi is not exact the above formula for radians will not catch the errors for 1 or 2 sides.
    Last edited by JohnVB6; Jul 26th, 2002 at 03:43 PM.
    Sometimes what you're looking for is exactly where you left it.

  4. #4
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    396
    Can u tell me when N will be 0, 1 or 2 for a polygon?
    Last edited by transcendental; Jul 26th, 2002 at 07:34 AM.

  5. #5
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271
    If the formulas are used in VB you must consider every possibility regarding user interaction.
    Sometimes what you're looking for is exactly where you left it.

  6. #6

    Thread Starter
    Hyperactive Member DavidHooper's Avatar
    Join Date
    Apr 2001
    Posts
    357
    Yeh both correct Guv and JohnVB6. Someone else post a new thread now.
    There are 10 types of people in the world - those that understand binary, and those that don't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width