contoursIntersection.cxx
Go to the documentation of this file.00001 #include "contoursIntersection.h"
00002
00003
00004 contoursIntersection::contoursIntersection()
00005 {
00006 }
00007
00008 contoursIntersection::~contoursIntersection()
00009 {
00010 }
00011
00012 double contoursIntersection::Slope(double x0, double y0, double x1, double y1)
00013 {
00014 double m = (y1-y0)/(x1-x0);
00015 return m;
00016 }
00017
00018 double contoursIntersection::Normal(double x0, double y0, double* m, double xi)
00019 {
00020 double y;
00021 *m = -(1/(*m));
00022 y = ((*m)*(xi - x0)) + y0;
00023 return y;
00024 }
00025
00026 void contoursIntersection::Intersection(double x01, double y01, double x02, double y02, double mn, double m2, double* x, double* y)
00027 {
00028 *x = ( y02-y01-(m2*x02)+(mn*x01) )/(mn-m2);
00029 *y = m2*(*x-x02)+y02;
00030 }
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040