Skip to content

Commit e083421

Browse files
author
Sven
committed
some comments
1 parent fd68638 commit e083421

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ledsa/ledpositions/coordinates.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from ..core import _led_helper as ledh
22
from ..core import ledsa_conf as lc
33
import os
4-
# from math import *
54
from scipy import linalg
65
from scipy.optimize import curve_fit
76
import numpy as np
@@ -95,13 +94,16 @@ def calculate_2d_coordinates(points):
9594
def _orth_projection(point, line, point_on_line):
9695
# normalized direction vector of line
9796
line_hat = (line / np.linalg.norm(line)).flatten()
97+
9898
# vector between the line and the normalized direction vector of the line
9999
line_pos = point_on_line.flatten() - point_on_line.flatten().dot(line_hat)*line_hat
100+
100101
# projection of the point onto the line
101102
projection = point.flatten().dot(line_hat)*line_hat + line_pos
102103
return projection
103104

104105

106+
# Uses least squares to fit a plane through an array of points. The fitted plane is orthogonal to the xy-plane.
105107
def _fit_plane(points: np.ndarray):
106108
def plane_func(point, a, b, d):
107109
return -1./b * (a*point[0]+d)
@@ -120,6 +122,7 @@ def _project_points_to_plane(points: np.ndarray, plane: np.ndarray):
120122
return projection
121123

122124

125+
# Transforms the coordinate system of points on a plane orthogonal to the xy-plane from 3D to 2D.
123126
def _get_plane_coordinates(points: np.ndarray, plane: np.ndarray):
124127
plane_coordinates = np.ndarray((2, points.shape[1]))
125128

0 commit comments

Comments
 (0)