Graphics UnitMath Example: ( Plane Geometry )
Last Modified: 2/17/ 2000

email Examples FAQ Home Sales $$$ What's New Windows demo

The following examples show how to use UnitMath with geometric figures in the plane.

Triangle Area TOP

Graphics

There are several ways to find the area of a triangle. Four of the most useful cases are shown below

a, b, & c are known. This is known as "Heron's Formula".
area = sqrt( S(S-a)(S-b)(S-c) ) where S = 1/2 (a+b+c)
a, b, & C are known
area = 1/2 a b sin(C)
a, B, & C are known
area = a^2/2 sin(B)sin(C)/sin(B+C)
The vertices are known
area = 1/2( x1(y2-y3)+x2(y3-y1)+x3(y1-y2) )

Examples

a, b, & c are known.

a: (5.31 pm 0) in; b: (7.09 pm 0) in; c: (8.86 pm 0) in;

S: ( a + b + c ) / 2;
area: sqrt( S(S-a)(S-b)(S-c) ) as sq in; ~ 18.824 sq in

Considering uncertainty we get:
a: 5.31 in; b: 7.09 in; c: 8.86 in;
area ~ ( 18.793 to 18.855 ) sq in


a, b, & C are known.

a: (5.3174 pm 0) in; b: (7.0898 pm 0) in; C: 45 deg;
area: 1/2 a b sin( C ) as sq in ~ 13.329 sq in

Considering uncertainty we get:
a: 5.3174 in; b: 7.0898 in; C: 45.0 deg;
area: 1/2 a b sin( C ) as sq in ~ 13.3 sq in


a, B, & C are known.

a: (14.625 pm 0) in; B: (70.54 pm 0) deg; C: (62.96 pm 0) deg;
area: sq a /2 sin(B)sin(C)/sin(B+C) as sq in ~ 123.817 sq in

Considering uncertainty we get:
a: 14.625 in; B: 70.54 deg; C: 62.96 deg;
area: sq a /2 sin(B)sin(C)/sin(B+C) as sq in ~ ( 123.779 to 123.855 ) sq in


The vertices are known.

x1: 0 in; y1: 0 in;
x2: 4 in; y2: 0 in;
x3: 4 in; y3: 3 in;
area: 1/2( x1(y2-y3)+x2(y3-y1)+x3(y1-y2) ) as sq in = 6 sq in

Considering uncertainty we get:
x1: 0.0 in; y1: 0.0 in;
x2: 4.0 in; y2: 0.0 in;
x3: 4.0 in; y3: 3.0 in;
area: 1/2( x1(y2-y3)+x2(y3-y1)+x3(y1-y2) ) as sq in ~ ( 5.650 to 6 to 6.355 ) sq in


Circle from 3 points TOP

Graphics

It is well known that a circle can be defined by three non-colinear points, but the equation for a circle is (x-x0)^2+(y-y0)^2=r^2. The following equations find the center ( x0, y0 ) and the Radius r of a circle; given: three points on a circle "( x1, y1 ), ( x2, y2 ), ( x3, y3 )".

K1: ( (x2-x1) (x2+x1) + (y2-y1) (y2+y1) ) / ( 2 ( x2-x1 ) );
K2: ( (x3-x1) (x3+x1) + (y3-y1) (y3+y1) ) / ( 2 ( x3-x1 ) );

N1: ( y2-y1 ) / (x2-x1);
N2: ( y3-y1 ) / (x3-x1);

y0: (K2 - K1) / (N2 - N1);
x0: K2 - N2 y0;
r: sqrt( (x3-x0)^2 + (y3-y0)^2 );

Examples

The points on the circle are known exactly.

x1: 10 in; y1: 0 in;
x2: 5 in; y2: 5 in;
x3: 0 in; y3: 0 in;

K1: ( (x2-x1) (x2+x1) + (y2-y1) (y2+y1) ) / ( 2 ( x2-x1 ) );
K2: ( (x3-x1) (x3+x1) + (y3-y1) (y3+y1) ) / ( 2 ( x3-x1 ) );

N1: ( y2-y1 ) / (x2-x1);
N2: ( y3-y1 ) / (x3-x1);

y0: (K2 - K1) / (N2 - N1) as in; = 0 in
x0: K2 - N2 y0 as in; = 5 in
r: sqrt( (x3-x0)^2 + (y3-y0)^2 ) as in; = 5 in

So the circle has a radius of 5 inches and its center is located at ( 5 in, 0 in )


Considering uncertainty we get:

x1: 1 in; y1: 1 in;
x2: 3.5 in; y2: -7.6 in;
x3: 12 in; y3: 0.80 in;

y0; ~ ( -2.130 to -2.030 ) in
x0; ~ ( 6.444 to 6.448 ) in
r; ~ ( 6.232 to 6.281 ) in

So the circle has a radius of about 6.2 inches and its center is located at about ( 6.4 in, -2. in )


TOP