当前位置:网站首页>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)边栏推荐
- Shufflenet series (2): explanation of shufflenet V2 theory
- c语言 比大小的多种描述,不要只拘泥于一种写法
- Openharmony quick start
- 裁剪tif影像
- Inherit, inherit, inherit
- 公司给了IP地址如何使用(详细版)
- [Network Research Institute] attackers scan 1.6 million WordPress websites to find vulnerable plug-ins
- [4.7 Gauss elimination details]
- Web middleware log analysis script 1.0 (shell script)
- Programmers must do 50 questions
猜你喜欢
![[qt] container class, iterator, foreach keyword](/img/88/d9d5be096009b4e5baa0966e6f292c.jpg)
[qt] container class, iterator, foreach keyword

Huffman encoding and decoding

Use of postman
![[4.10 detailed explanation of game theory]](/img/df/690f9fb3adcb00317eb3438a76baaa.png)
[4.10 detailed explanation of game theory]

7_ Principal component analysis

C language shutdown applet

继承,继承,继承

Find method of web page parsing by crawler

Eight queens n Queens

Based on the theoretical principle and simulation results of MATLAB spherical decoding, compare 2norm spherical decoding, infinite norm spherical decoding, ML detection
随机推荐
【4.7 高斯消元详解】
Friend友元函数以及单例模式
MySql
Parallel MPI program delivery send message
[PCB open source sharing] stc8a8k64d4 development board
2020-12-22 maximum common factor
公司给了IP地址如何使用(详细版)
My first blog - confused junior
[3. Basic search and first knowledge of graph theory]
CDs simulation of minimum dominating set based on MATLAB
AutoCAD的卸载后重新安装,删除注册表的详细过程
Shufflenet series (2): explanation of shufflenet V2 theory
Drawing warehouse Tsai
[qt] container class, iterator, foreach keyword
并行MPI程序传递发送消息
10_ Evaluate classification
Drawing warehouse-2 (function image)
【3. 基础搜索与图论初识】
MySQL associative table queries (reducing the number of queries)
输入一串字母 将里面的元音输出希望各位大佬能给指导