当前位置:网站首页>Point to plane projection
Point to plane projection
2022-07-27 00:44:00 【ancy_ i_ cv】
Algorithm principle :

1. Find the direction vector from the point on the plane to the point outside the plane :
v = point-orig( In each dimension );2. Compare the point of the vector with the unit normal vector n Obtain the projection distance by dot multiplication :
dist = vx*nx + vy*ny + vz*nz;dist # The distance from the point to the plane 3. Multiply the unit normal vector by the distance , Then subtract the vector from the point outside the plane to obtain the projection point .
projected_point = point -dist*normal;Above picture : Red as v;dist It's blue and green in length , be equal to v Point multiplication normal. Blue is normal*dist. Green is the same as blue , They are just drawn in different places . To find the Planar_xyz, Please start at , Then subtract the green vector .
Code implementation :
import numpy as np
point_in_plane = np.array([0, 0, 0])
normal_in_plane = np.array([0, 13, 1])
points = np.array([1, 1, 1])
def ProjectPointsToPlane(point_in_plane, normal_in_plane, points):
v = points - point_in_plane
normalized_normal_in_plane = normal_in_plane / np.linalg.norm(normal_in_plane)
dist = v.dot(normalized_normal_in_plane)
projected_points = (points - dist * normalized_normal_in_plane)
return projected_points
ProjectPointsToPlane(point_in_plane, normal_in_plane, points)边栏推荐
- [acwing game 61]
- [4.9 detailed explanation of inclusion exclusion principle]
- Reduced dimension mean dot product matrix multiplicative norm probability normal distribution square loss
- Collection of 3D LUT related articles
- The crawler parses the object of the web page. Element name method
- 2020-12-22最大公因数
- V-viewer use
- 2020-12-20 99 multiplication table
- 10_ Evaluate classification
- "Syntaxerror: future feature annotations is not defined"
猜你喜欢

DOM day_01(7.7) dom的介绍和核心操作
![[3. Basic search and first knowledge of graph theory]](/img/a2/dced231f746cc049d310e364a81856.png)
[3. Basic search and first knowledge of graph theory]

Matlab simulation of inverted pendulum control system based on qlearning reinforcement learning

Linux系统中安装Redis-7.0.4

关于Thymeleaf的表达式

Signal and system impulse response and step response
![[qt] container class, iterator, foreach keyword](/img/88/d9d5be096009b4e5baa0966e6f292c.jpg)
[qt] container class, iterator, foreach keyword

继承,继承,继承

C语言 求素数、闰年以及最小公倍数最大公约数

5_ Linear regression
随机推荐
C语言 关机小程序
【AtCoder Beginner Contest 261 (A·B·C·D)】
[qt] solve the problem of Chinese garbled code
输入一串字母 将里面的元音输出希望各位大佬能给指导
Web middleware log analysis script 2.0 (shell script)
[qt] attribute
我的第一篇博客-迷茫的大三人
Resolve Microsoft 365 and Visio conflicts
JSCORE day_01(6.30) RegExp 、 Function
[Qt]解决中文乱码问题
Oracle data guard service, process and protection mode
MySQL common functions (summary)
【4.1 质数及线性筛】
Ansible MySQL installation case record
The crawler parses the object of the web page. Element name method
Collection of 3D LUT related articles
DOM day_ 03 (7.11) event bubbling mechanism, event delegation, to-do items, block default events, mouse coordinates, page scrolling events, create DOM elements, DOM encapsulation operations
Reduced dimension mean dot product matrix multiplicative norm probability normal distribution square loss
CDs simulation of minimum dominating set based on MATLAB
DOM day_04(7.12)BOM、打开新页面(延迟打开)、地址栏操作、浏览器信息读取、历史操作