Mathematical scripts

Sometimes you need a small algorithm for a game, for instance a test if a point is inside or outside a triangle defined by three other points.

You can make and test your own solution which will certainly be very instructive, but other very dedicated people have come up with clever solutions and these are very tested!

a good link is: http://www.gmlscripts.com/

for instance, for the problem mentioned above you type triangle in the search field and it comes up with the solution in a readable format:

http://www.gmlscripts.com/script/point_in_triangle

it is easily translated in c for our nds purposes!

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: