-
Notifications
You must be signed in to change notification settings - Fork 4
/
circle.d.ts
113 lines (97 loc) · 2.14 KB
/
circle.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
declare module 'Circle';
interface Point {
x: number;
y: number;
}
interface Circle {
x: number;
y: number;
r: number;
}
declare class Circle {
/**
* Determines if two circles intersect
*
* @param a Circle
* @param b Circle
* @returns boolean
*/
static intersect(a: Circle, b: Circle): boolean;
/**
* Determines if a point is within a circle
*
* @param c Circle
* @param p Point
* @returns boolean
*/
static intersectPoint(c: Circle, p: Point): boolean;
/**
* Calculates the intersection points of two circles
*
* @param A Circle
* @param B Circle
* @returns Point[] | null
*/
static intersection(A: Circle, B: Circle): Point[] | null;
/**
* Calculates the intersection area of two circles
*
* @param A Circle
* @param B Circle
* @returns number
*/
static intersectionArea(A: Circle, B: Circle): number;
/**
* Calculates the area of a circle
*
* @param c Circle
* @returns number
*/
static area(c: Circle): number;
/**
* Calculates the height of a circle
*
* @param a Circle
* @returns number
*/
static height(a: Circle): number;
/**
* Calculates the width of a circle
*
* @param a Circle
* @returns number
*/
static width(a: Circle): number;
/**
* Calculates the perimeter of a circle
*
* @param a Circle
* @returns number
*/
static perimeter(a: Circle): number;
/**
* Calculates the center point of a circle
*
* @param a Circle
* @returns Point
*/
static center(a: Circle): Point;
/**
* Resizes the circle by a given value on the center
*
* @param c Circle
* @param w number
* @returns Circle
*/
static insetBy(c: Circle, w: number): Circle;
/**
* Calculates a circle given three points
*
* @param p1 Point
* @param p2 Point
* @param p3 Point
* @returns Circle
*/
static fromThreePoints(p1: Point, p2: Point, p3: Point): Circle;
}
export { Circle as default };