line.h

来自「将数学上的线段作为一对象进行封装成类,实现两直线相交求交点等」· C头文件 代码 · 共 36 行

H
36
字号
// Line.h: interface for the Line class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LINE_H__9A9B6C22_D015_4640_88C6_C55774193D02__INCLUDED_)
#define AFX_LINE_H__9A9B6C22_D015_4640_88C6_C55774193D02__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Point.h"
#include "Angle.h"
class Line  
{
public:
	Point Start,End;
	double Offset;
	Line();
    Point Inersection(Line l);
	Line&  operator =(Line l);
	BOOL  Nearest(Point p,  Point* IntersP,double* dist);//在直线右侧*dist为负,反之为正
	BOOL  Nearest(double x,double y,  Point* IntersP,double* dist);
	BOOL  IsInTheLine(Point P,double det=0.003);
	BOOL  IsInTheLine(double x,double y,double det=0.003);
	BOOL  IsInTheRightSide(double x,double y);
	Point GetCentrlPoint(double l0,Angle* RoadDirection,double dist=0);
	virtual ~Line();

};




#endif // !defined(AFX_LINE_H__9A9B6C22_D015_4640_88C6_C55774193D02__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?