From: Martin Read Date: Thu, 22 Mar 2012 19:22:44 +0000 (+0000) Subject: Fixed up Line class and created man page. X-Git-Url: http://git.blackswordsonics.com/?a=commitdiff_plain;h=804d2983424c43ba7c600762b7d342d26bb08c96;p=libmormegil Fixed up Line class and created man page. --- diff --git a/include/libmormegil/Line.hh b/include/libmormegil/Line.hh index ab9d714..c96bc9d 100644 --- a/include/libmormegil/Line.hh +++ b/include/libmormegil/Line.hh @@ -23,6 +23,9 @@ namespace libmormegil typedef const basic_coord& const_punktref; basic_coord topleft; basic_coord botright; + T length_taxi() const { return topleft.dist_taxi(botright); } + T length_inf() const { return topleft.dist_inf(botright); } + T lengthsq() const { return topleft.distsq(botright); } }; typedef basic_line Line; typedef basic_line Line64; diff --git a/man/libmormegil::Line.3 b/man/libmormegil::Line.3 new file mode 100644 index 0000000..85d9898 --- /dev/null +++ b/man/libmormegil::Line.3 @@ -0,0 +1,28 @@ +.TH "LIBMORMEGIL::LINE" 3 "March 22, 2012" "libmormegil Version 1.1" "libmormegil User Manual" +.SH NAME +libmormegil::basic_line, libmormegil::Line, libmormegil::Line64 \- line segments on a plane +.SH SYNOPSIS +#include + +.SH DESCRIPTION +.I libmormegil::basic_line +is a template type for representing line segments on a two-dimensional plane. + +The member functions \fIlength_taxi\fP and \fIlength_inf\fP return the +length of the line segment under the L_1 (aka "Manhattan" or "taxicab") and +L_inf (aka "Chebyshev" or "chessboard") metrics, respectively. The member +function \fIlengthsq\fP returns the square of the magnitude of the length +under the Euclidean metric. + +A typedef \fIlibmormegil::Line\fR is provided; this uses type \fIint32_t\fR +as the template parameter. + +A typedef \fIlibmormegil::Line64\fR is provided; this uses type \fIint64_t\fR +as the template parameter. + +.SH AUTHOR +Martin Read + +.SH SEE ALSO + +libmormegil(3)