|
degate 0.1.1
|
Go to the source code of this file.
Functions | |
| bool | get_line_function_for_wire (degate::Line_shptr l, double *m, double *n) |
| Calculate the parameter for a linear function f(x) = m*x + n. | |
| bool get_line_function_for_wire | ( | degate::Line_shptr | l, |
| double * | m, | ||
| double * | n | ||
| ) |
Calculate the parameter for a linear function f(x) = m*x + n.
Definition at line 29 of file TangencyCheck.cc.
Referenced by degate::check_object_tangency().
{
assert(l != NULL);
assert(m != NULL);
assert(n != NULL);
int d_y = l->get_to_y() - l->get_from_y();
int d_x = l->get_to_x() - l->get_from_x();
if(abs(d_x) == 0) return false;
else {
*m = static_cast<double>(d_y) / static_cast<double>(d_x);
*n = l->get_from_y() - l->get_from_x() * *m;
return true;
}
}

1.7.4