Code archives/Algorithms/Estimating area

This code has been declared by its author to be Public Domain code.

Download source code

Estimating area by Andy2009
Basically calculates the area facing a direction, based on 3 different area totals.

I wrote it for a flight sim, but it could be used for other things as well.
frontarea#=50.0
Toparea#=50.0
sidearea#=50.0
totalarea#=0.0

yaw#=45.0
pitch#=0.0
roll#=0.0

totalarea#=Abs(Sin(yaw#)*sidearea#)+Abs(Cos(yaw#)*(Abs(Sin(pitch#)*toparea#)+Abs(Cos(pitch#)*frontarea#)))

Print "Total: "+totalarea#

WaitKey()

Comments

None.

Code Archives Forum