Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Font Pool
MIAW Event Leak
Custom Hyperlink Colors And Cursor Change
f3SoundFX
Light Up
cXtraTwain
SpellerRT
Swipe Cast Members
Custom Projector Icon
Puzzler - Puzzle Maker
 

 

 

Behavior Find angles of a right triangle

Added on 7/1/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: GlennPicher (website)

Just be sure you don"t pass in 0 length base or height values, or you"ll get a divide by zero error. The answer is returned in radians. It you need to calculate both angles, it would be faster to calculate one angle and then derive the other angle by subtracting from 90 degrees. Transcendental math functions are rather slow.

on topAngle base, height
  return atan(base/height)
end

on sideAngle base, height
  return atan(height/base)
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail