File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
from ..core import _led_helper as ledh
2
2
from ..core import ledsa_conf as lc
3
3
import os
4
- # from math import *
5
4
from scipy import linalg
6
5
from scipy .optimize import curve_fit
7
6
import numpy as np
@@ -95,13 +94,16 @@ def calculate_2d_coordinates(points):
95
94
def _orth_projection (point , line , point_on_line ):
96
95
# normalized direction vector of line
97
96
line_hat = (line / np .linalg .norm (line )).flatten ()
97
+
98
98
# vector between the line and the normalized direction vector of the line
99
99
line_pos = point_on_line .flatten () - point_on_line .flatten ().dot (line_hat )* line_hat
100
+
100
101
# projection of the point onto the line
101
102
projection = point .flatten ().dot (line_hat )* line_hat + line_pos
102
103
return projection
103
104
104
105
106
+ # Uses least squares to fit a plane through an array of points. The fitted plane is orthogonal to the xy-plane.
105
107
def _fit_plane (points : np .ndarray ):
106
108
def plane_func (point , a , b , d ):
107
109
return - 1. / b * (a * point [0 ]+ d )
@@ -120,6 +122,7 @@ def _project_points_to_plane(points: np.ndarray, plane: np.ndarray):
120
122
return projection
121
123
122
124
125
+ # Transforms the coordinate system of points on a plane orthogonal to the xy-plane from 3D to 2D.
123
126
def _get_plane_coordinates (points : np .ndarray , plane : np .ndarray ):
124
127
plane_coordinates = np .ndarray ((2 , points .shape [1 ]))
125
128
You can’t perform that action at this time.
0 commit comments