SA-Kenan/04_Spurerkennung/dev/dev_Fußpunkt.py

36 lines
653 B
Python
Raw Normal View History

2022-05-09 20:30:26 +02:00
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 27 11:30:48 2022
@author: Kenan
"""
import numpy as np
p = np.array([[2],[5],[-1]])
#p = np.array([[208],[160]])
#p= np.transpose(p)
#p = np.array([2,5,-1])
a = np.array([[2],[0],[1]])
#a = np.array([[194.375],[237.375]])
#a= np.transpose(a)
#a = np.array([2,0,1])
b = np.array([[2],[-1],[2]])
#b = np.array([[0.980569],[-0.19617459]])
#b= np.transpose(b)
#b = np.array([2,-1,2])
c = p-a
cross= np.cross(b[:,0], c[:,0])
res = np.linalg.norm(cross)/np.linalg.norm(b)
# Fußpunkt L
t_0_dot = np.dot(c[:,0], b[:,0])
t_0_norm = (np.linalg.norm(b[:,0])**2)
t_0 = t_0_dot/t_0_norm
x_0 = (a+t_0*b)[:,0]