point2d.h
资源名称:package.rar [点击查看]
上传用户:chinasdcnc
上传日期:2022-07-02
资源大小:2702k
文件大小:1k
源码类别:
分形几何
开发平台:
Visual C++
- //
- // Delaunay Triangulation
- //
- // Homework of CG lesson (Fall 2009) in Tsinghua University.
- // All rights reserved.
- //
- #pragma once
- #include "vector2d.h"
- /**
- * class for 2d point.
- */
- class Point2d
- {
- // public constructors & destructor
- public:
- /**
- * Sets all coordinate values to 0.0 by default.
- */
- Point2d(void);
- /**
- * Sets x, y coordinate values with @c tx and @c ty.
- */
- Point2d(double tx, double ty);
- /**
- * Copy constructor.
- */
- Point2d(const Point2d& p);
- // public member functions
- public:
- /**
- * Operator + for @c v.
- */
- Point2d operator+(const Vector2d& v) const;
- /**
- * Operator - for @c p.
- */
- Vector2d operator-(const Point2d& p) const;
- /**
- * Operator ==.
- */
- bool operator==(const Point2d& p) const;
- /**
- * Operator <
- */
- bool operator<(const Point2d& p) const;
- // public data members
- public:
- double x;
- double y;
- };