-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtil.py
More file actions
44 lines (30 loc) · 1.34 KB
/
Util.py
File metadata and controls
44 lines (30 loc) · 1.34 KB
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
import math
class Util:
@staticmethod
# Function uses derived formula from L_1 metric unit sphere to find points in the 4th quadrant
def ComputeNewLineFourthQuadrant(distance, prevHead):
midPoint = (distance/ 2)
k = int(midPoint)
endPoint = ( (prevHead[0] + k), (k + prevHead[1] - distance) )
return endPoint
# Function uses derived formula from L_1 metric unit sphere to find points in the 1st quadrant
def ComputeNewLineFirstQuadrant(distance, prevHead):
midPoint = (distance/ 2)
k = int(midPoint)
endPoint = ( (prevHead[0] + k), (prevHead[1] + distance - k ) )
return endPoint
def ComputeNewLineThirdQuadrant(distance, prevHead):
midPoint = (distance/ 2)
k = int(midPoint)
endPoint = ( (prevHead[0] - k), (k + prevHead[1] - distance) )
return endPoint
# Function uses derived formula from L_1 metric unit sphere to find points in the 1st quadrant
def ComputeNewLineSecondQuadrant(distance, prevHead):
midPoint = (distance/ 2)
k = int(midPoint)
endPoint = ( (prevHead[0] - k), (prevHead[1] + distance - k ) )
return endPoint
# Get the length of the phantom line.
def ModifySpiralStep(length, SPIRAL_STEP_SIZE):
step_size = (length * SPIRAL_STEP_SIZE)
return step_size