#ifndef NLINE_H
# define NLINE_H

# ifndef GPK_STD_H
#  include <gpk_std.h>
# endif
# ifndef V2_H
#  include "v2.h"
# endif




class nline	{
	vector2 _base, _dir, _q;	/* parametric form. */

	public:
	nline(C vector2& base_, C vector2& dir_, C vector2& q_)
		: _base(base_), _dir(dir_), _q(q_)	{}
	nline(C nline& i) : _base(i._base), _dir(i._dir), _q(i._q) {}
	nline& operator=(C nline& i) {_base=i._base; _dir=i._dir;
									_q=i._q; return *this;}

	C vector2& base() C	{return _base;}
	C vector2& dir() C	{return _dir;}
	C vector2& q() C	{return _q;}

	vector2 operator()(double s) C;
	BOOL check_hasangle(double theta) C;
	double p_hasangle(double theta) C;
	vector2 hasangle(double theta) C	{return (*this)(p_hasangle(theta));}
	double angle(double s) C;
	BOOL ok() C;
	};

nline operator+(C nline& a, C vector2& b);
inline nline operator-(C nline& a, C vector2& b)	{return a + (-b);}
inline nline operator+(C vector2& b, C nline& a)	{return a+b;}

#endif
