Discussion:  All Topics in Trigonometry on Computer 
Topic:  Difficult algorithm design; I could use some suggestions 
Post a new topic to the All Content in Trigonometry on Computer discussion 

Subject:  Difficult algorithm design; I could use some suggestions 
Author:  tarahmarie 
Date:  Aug 27 2006 
This is my first time posting here; please be patient with me until I learn the
forum norms and mores ;)
I am writing an agentbased model in Java using the RePast code library. I
don't need computer help; I need help developing an algorithm to do something
VERY specific. I had a really good idea for a new implementation of an old
model, but the problem is that I'm developing this algorithm from scratch. I
need (1) an equilateral triangle with an area of 256 and the value of all the
sides, (2) a function to graph this triangle in Cartesian space with one side
lying on the Xaxis, (3) a way to divide this triangle into seven stages
possibly by identifying six points on the yaxisas one is traveling up to
the point; the stages being an exponent of 2, meaning that the bottom stage has
area 128, the second stage has area 64, etc for stages 37 with areas 32, 16,
8, 4, and 2, (4) a way to add an exponential function to the graph that cuts
through the triangle and passes through the top point of the triangle while
shading progressively less and less of the stages of the triangle. Envision a
triangle with a function something like x^3/2 cutting through it by starting at
the triangle's left bottom corner at (0, 0) and passing out through the tip of
the triangle. As the function passes through the triangle, imagine shading the
area of the triangle to the right of the function. As you can tell, the
function will proportionately shade less and less of each stage as it climbs.
Problem # 1: I can't seem to find a value for a side of this triangle with an
area of 256 that I can check properly. I was trying to use the formula for the
area of an equilateral triangle (1/4 * sqrt 3 * a^2) where a is a side of the
equilateral triangle, then use the Pythagorean Theorem to find a value for the
height of the triangle (the long side of the right triangle that is half the
area of the full equilateral triangle, b^2 in a^2+b^2=c^2). Then I try to check
my work by using the simple formula for the area of a triangle (1/2bh), but I
never get the same area as I did when using the formula for the area of an
equilateral triangle. I get a value of 32/(3^1/4) for one side of the triangle,
but it never checks when I try to use 1/2bh. What am I doing wrong?
Can anybody help out?
 
Post a new topic to the All Content in Trigonometry on Computer discussion  
Visit related
discussions: Trigonometry Computer  