angelcolmenares / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

More Line construction options. #174

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This provides Line.FromSlopeIntercept, Line.FromRTheta, and Line.FromPointTheta 
factory methods, and tests for same. It also privatizes the Line(Point,Point) 
constructor, on the theory that having both constructors and factory methods is 
a great way to make users never notice the factories.

Because a Line no longer necessarily has user-specified points, this portion of 
Line has been moved to a new LineSegment class, which must be constructed from 
two points, and has an explicit (and cheap) conversion to Line.

I could add LineSegment.DistanceToPoint here, but I thought it would be better 
in a separate issue.

Original issue reported on code.google.com by dales...@gmail.com on 13 Nov 2010 at 1:27

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by andrew.k...@gmail.com on 13 Nov 2010 at 8:15

GoogleCodeExporter commented 8 years ago
Merged. Committed in revision 1344. Will be released in version 2.1.5.

I liked the previous path from you more than this, since it required me less to 
modify :) In this patch you forgot to update some docs - Line's sample code was 
still using old constructors. Also you copy-pasted Line's sample into 
LineSegment into left it as it is (I removed that for now until we get better 
sample).

But still looks fine.

Original comment by andrew.k...@gmail.com on 13 Nov 2010 at 4:50

GoogleCodeExporter commented 8 years ago

Original comment by andrew.k...@gmail.com on 12 Jan 2011 at 11:45