4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
13 marLine::marLine(double x1, double y1, double x2, double y2){
14 this->a = y2 - y1; //REVISAR SIGNO
16 this->c = (y1 - y2) * x1 + (x2 - x1)*y1;
19 // ----------------------------------------------------------------------------
20 marLine::marLine(double a, double b){
26 // ----------------------------------------------------------------------------
27 void marLine::getNormal(double *a, double *b){
32 // ----------------------------------------------------------------------------
33 void marLine::getIntersect(double a, double b, double c, double *x, double *y){
47 *x = (c*this->b - this->c*b) / (this->a*b - a*this->b);
52 *y = -this->c/this->b;
54 *y = (-this->a*(*x) - this->c) / this->b;
58 if (*x < 0 || *y < 0){
64 // ----------------------------------------------------------------------------
65 double marLine::getA(){
69 // ----------------------------------------------------------------------------
70 double marLine::getB(){
74 // ----------------------------------------------------------------------------
75 double marLine::getC(){
79 // ----------------------------------------------------------------------------