Geometric operations in the cartesian plan
Hello everyone. I have to implement a few tasks and some of that are quite easy to understand (and to implement)
1) Definition of a Line by means of Two Points (Created class Point with x,y, and the class TwoPointLine that has this two points)
2) Definition of a line by means of gradient and y-intercept (For what I understand is the y=mx+c formula. But should I consider only
m
and c
on this class or also x
being passed as a point)
3)Condititons on parallelism etc. (Done)
Now what I've done is creating an Interface called Line and the two definitions will implement such interface with methods like (GetSlop(), isParallel etc.) Since the same formula is used for isParallel and the other definitions, I implemented them as default in the Interface (Don't know if I did right on this)...
The main thing that I'm asking is for point 2, if in your opinion I should pass also X as an argument to the constructor, or not. Or maybe i'm completely off and I misunderstood that line... Not asking for the code, just to understand a little bit more.0 Replies