Changeset 1800
 Timestamp:
 Sep 7, 2005, 4:29:49 PM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

inundation/pyvolution/mesh.py
r1670 r1800 536 536 537 537 for u, v in [ (v0, normal2), (v1, normal0), (v2, normal1) ]: 538 assert u[0]*v[0] + u[1]*v[1] < epsilon 538 539 #Normalise 540 from math import sqrt 541 l_u = sqrt(u[0]*u[0] + u[1]*u[1]) 542 l_v = sqrt(v[0]*v[0] + v[1]*v[1]) 543 544 x = (u[0]*v[0] + u[1]*v[1])/l_u/l_v #Inner product 545 546 msg = 'Normal vector (%f,%f) is not perpendicular to' %tuple(v) 547 msg += ' edge (%f,%f) in triangle %d.' %(tuple(u) + (i,)) 548 msg += ' Inner product is %e.' %x 549 assert x < epsilon, msg 539 550 540 551
Note: See TracChangeset
for help on using the changeset viewer.