⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 geometry.h

📁 this a Navier-Stokes equations solver. It support grids contains of multiple connected rectangles. S
💻 H
字号:
#ifndef _GEOMERTY_H_
#define _GEOMETRY_H_

template<class T>
struct point
{
	point():x(0),y(0){}
	point(T _x,T _y):x(_x),y(_y){}

	T x;
	T y;
};

template<class T>
point<T> inline operator - (const point<T> &a,const point<T> &b)
{
	return point<T>(a.x - b.x, a.y - b.y);
}

template<class T,class P>
point<T> inline operator / (const point<T> &a,const point<P> &b)
{
	return point<T>(a.x / b.x, a.y / b.y)
}

template<class T>
struct rect
{
	point<T> a;
	point<T> b;

	bool inline inside(const point<T> &p){
		return p.x >= a.x && p.x < b.x && p.y >= a.y && p.y < b.y;
	}
	bool inline inclusive_inside(const point<T> &p){
		return p.x >= a.x && p.x <= b.x && p.y >= a.y && p.y <= b.y;
	}
};

#endif

⌨️ 快捷键说明

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