January 26, 2021, 05:04:24 AM

Author Topic: [bb] Estimating area by Andy [ 1+ years ago ]  (Read 403 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Estimating area by Andy [ 1+ years ago ]
« on: June 29, 2017, 12:28:40 AM »
Title : Estimating area
Author : Andy
Posted : 1+ years ago

Description : 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.


Code :
Code: BlitzBasic
  1. frontarea#=50.0
  2. Toparea#=50.0
  3. sidearea#=50.0
  4. totalarea#=0.0
  5.  
  6. yaw#=45.0
  7. pitch#=0.0
  8. roll#=0.0
  9.  
  10. totalarea#=Abs(Sin(yaw#)*sidearea#)+Abs(Cos(yaw#)*(Abs(Sin(pitch#)*toparea#)+Abs(Cos(pitch#)*frontarea#)))
  11.  
  12. Print "Total: "+totalarea#
  13.  
  14. WaitKey()


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal