21 Dec
2013
21 Dec
'13
1:18 a.m.
I prefer to declare variables as I use them, but I can't remember what style the code uses. Can you check please.
+ if(Geom::are_near(dot(v1,v2),1.0)){ // P1 is within a straight line
I would use cross here, which is more numerically stable in this case because it has error that is linear rather than quadratic with divergences (I think).
+ if(Geom::are_near(cross(v1,v2),0.0)){ // P1 is within a straight line
Can you fix the spacing up to match the code - you've go a somewhat arbitrary mix of no space, single space and double space around operators.
Other than that, it looks fine.
njh