-
Notifications
You must be signed in to change notification settings - Fork 3
/
Circle.h
22 lines (17 loc) · 724 Bytes
/
Circle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Circle.h
// Copyright 2011, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#pragma once
#include "Point.h"
class CircleOrLine {
public:
bool m_is_a_line; // true for line, false for circle
Point m_c; // just for circle
double m_radius; // just for circle
Point m_p0; // just for line
Point m_p1; // just for line
CircleOrLine(const Point& c, double radius) :m_c(c), m_radius(radius), m_is_a_line(false) {}
CircleOrLine(const Point& p0, const Point& p1, const Point& p2); // circle through three points
bool PointIsOn(const Point& p, double accuracy);
bool LineIsOn(const Point& p0, const Point& p1, double accuracy);
};