RE: find area bounded by three linear functions
- To: mathgroup at smc.vnet.net
- Subject: [mg68389] RE: [mg68357] find area bounded by three linear functions
- From: "Erickson Paul-CPTP18" <Paul.Erickson at Motorola.com>
- Date: Thu, 3 Aug 2006 06:07:21 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hopefully someone has some modula with this in it, but ...
In[42]:= (* define Heron's formula *)
triangularArea[ a_, b_, c_] := Sqrt[(a + b + c)(a + b - c)(b +
c - a)(c + a - b)]/ 4
In[43]:= (* enter line equations *)
eqs = {x == 3y, x + y == 0, 7x + 3y == 24}
Out[43]=
{x == 3 y, x + y == 0, 7 x + 3 y == 24}
In[44]:= (* determine vertices by solving paired equations *)
vertexs =
Map[ Flatten,
Union[
Map[ Solve, Sort[
Map[ Most,
Permutations[ eqs]
, 1]
], 1 ]
]
]
Out[44]=
{{x -> 0, y -> 0}, {x -> 3, y -> 1}, {x -> 6, y -> -6}}
In[45]:= (* find distances by delta vertices, eliminate negative with
take 3 or sort and sqrt or sum of sqr *)
{ a, b, c } =
Map[ (#[[1]]^2 + #[[2]]^2)^(1/2) &,
Take[
Sort[
Map[ #[[1]] - #[[2]] &,
Union[
Map[ Most,
Permutations[
Map[ { x, y} /. # & , vertexs, 1 ]
]
, 1 ] ]
, 1 ]
]
, 3 ]
, 1]
Out[45]=
\!\({6\ \@2, \@10, \@58}\)
In[46]:= (* apply distances to Heron's formula *)
N[ triangularArea[ a, b, c ] ]
Out[46]=
12.
-----Original Message-----
From: T Harris [mailto:tdh1967 at bellsouth.net]
To: mathgroup at smc.vnet.net
Subject: [mg68389] [mg68357] find area bounded by three linear functions
How can I get Mathematica to find the area of the region bounded by all
three of the following linear functions? I have tried searching and
can't find it. What do I search for to find the commands to accomplish
this? I calculated by hand and come up with about 3.1623 sq. units for
area above the x-axis and 8.8378 sq. units below it. The total area for
the scalene triangle formed is 12 square units by my calculations using
Heron's formula.
X=3Y; X+Y=0; 7X + 3Y =24
Thanks,
T Harris