You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the Line class is implemented based on the equation: y = a x + b, where a is the slope of the line and b is its y-intercept. This is not ideal in my opinion. For example, in case of a vertical line, the slope is set to std::numeric_limits<double>::infinity() from the limits package.
A better implementation could be based on the equation: a x + b y + c = 0, which I think represents all orientations of a line in a cleaner way.
Another possibility to consider is to represent a line by a point and a vector, which is equivalent to a line parametrization:
x = x0 + vx t
y = y0 + vy t
As the whole implementation is still buggy, reimplementing the Line class and readapting all the other classes using it might help uncover bugs and hopefully fix them.
The text was updated successfully, but these errors were encountered:
So the
Line
class is implemented based on the equation: y = a x + b, where a is the slope of the line and b is its y-intercept. This is not ideal in my opinion. For example, in case of a vertical line, the slope is set tostd::numeric_limits<double>::infinity()
from the limits package.A better implementation could be based on the equation: a x + b y + c = 0, which I think represents all orientations of a line in a cleaner way.
Another possibility to consider is to represent a line by a point and a vector, which is equivalent to a line parametrization:
x = x0 + vx t
y = y0 + vy t
As the whole implementation is still buggy, reimplementing the
Line
class and readapting all the other classes using it might help uncover bugs and hopefully fix them.The text was updated successfully, but these errors were encountered: