3D angle Measurement

조회 수: 2 (최근 30일)
Emre Erdogan
Emre Erdogan 2018년 8월 20일
댓글: ADragon 2018년 8월 20일
Hello, I have an one 3D dataset of a metal object that i want to measure some data from it. I am able to measure the length etc but calculating the angles giving me hard time since it can be positioned in different angles itself. I was wondering what would be the best and simple thing to calculate the angles. How can i move the data to the certain xyz plane ? or is it possible to create another xyz plane with the reference points in the object thanks
  댓글 수: 3
Emre Erdogan
Emre Erdogan 2018년 8월 20일
편집: Emre Erdogan 2018년 8월 20일
It is just a one part metal object. It is like "r" slightly bended to right and slightly to backward. I managed to make a centerline so that it becomes easier to calculate. So the data is skeleton of the object now. I would use the coordinates of end points and turning points for making the calculation but since it is diffetently positioned in every scan i couldnt use it.
ADragon
ADragon 2018년 8월 20일
Hi Emre, you could use vector math. Using the equation cos(theta) = (u dot v)/(mag u * mag v)
p1 = rand(1,3); % Point 1
p2 = rand(1,3); % Point 2
p3 = rand(1,3); % Point 3
% Vector u from p2 to p1
% Vector v from p2 to p3
u = p1 - p2;
v = p3 - p2;
o = zeros(1,3);
udotv = sum(u.*v); % dot product of u and v
umag = norm(u); % vector magnitude of u
vmag = norm(v); % vector magnitude of v
theta = acos(udotv/(umag*vmag))*180/pi;
figure
p = [u; o; v];
plot3(p(:,1),p(:,2),p(:,3))
title(['Vector Angle = ' num2str(theta,4) ' deg'])
axis equal
grid on

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating Points에 대해 자세히 알아보기

제품


릴리스

R2013b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by