平面(ax+by+cz+d=0)への近似
Show older comments
3次元のランダムに散らばった点群データ(約1000点)から平面(ax+by+cz+d=0)への近似を行う方法を教えてください。
Accepted Answer
More Answers (1)
KSSV
on 15 Dec 2016
clc; clear all ;
% Ax + By + Cz + D = 0
% where the coefficients "A", "B", "C", and "D" are known values.
A = rand ; B = rand ; C = rand ; D = rand ; % considering some random values
%%Method 1
x = [1 -1 -1 1]; % Generate data for x vertices
y = [1 1 -1 -1]; % Generate data for y vertices
z = -1/C*(A*x + B*y + D); % Solve for z vertices data
patch(x, y, z);
%%method 2
[x y] = meshgrid(-1:0.1:1); % Generate x and y data
z = -1/C*(A*x + B*y + D); % Solve for z data
surf(x,y,z) %Plot the surface
2 Comments
Ichiro Suzuki
on 15 Dec 2016
KSSV
on 15 Dec 2016
You have to be bit clear about your question.What do you mean by approximate calculation?
Categories
Find more on Interpolation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!