Angle between two normals

About advanced scenes, and the Thyme scripting language used in Algodoo.

Angle between two normals

Postby Kilinich » Fri Oct 08, 2010 8:30 am

Here it is simplified formula for finding angle between two e.normal vectors:

Code: Select all
scene.my.na = (n1, n2) => {math.acos(n1(0)*n2(0) + n1(1)*n2(1)) * ((n1(0)*n2(1) - n1(1)*n2(0)) > 0 ? 1 : -1)}
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests