12
For vectors v1 and v2 check if they are orthogonal by
abs(scalar_product(v1,v2)/(length(v1)*length(v2))) < epsilon
where epsilon is small enough. Analoguously you can use
scalar_product(v1,v2)/(length(v1)*length(v2)) > 1 - epsilon
for parallelity test and
scalar_product(v1,v2)/(length(v1)*length(v2)) < -1 + epsilon
for anti-parallelity.