comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: find a plane in a 3D plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: find a plane in a 3D plot [message #62495 is a reply to message #62488] Fri, 12 September 2008 07:47 Go to previous messageGo to previous message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Fri, 12 Sep 2008 02:54:09 -0700 (PDT), Nicola
<nicola.vianello@gmail.com> wrote:

> I have to find a
> way to identify this plane and the direction perpendicular to this
> plane in the more accurate way as possible.


The code below is one way of doing things. The resulting plane is
defined with a normal vector and a point.



pro test
x=[1.,0,1,2,3,4]
y=[0.,1,1,2,3,4]
z=[2.,2,2,2,2,2]

; Orthogonal distance regression
; check e.g. http://mathforum.org/library/drmath/view/63765.html

; Centroid: orthogonal distance
; regression plane goes through it
n=n_elements(x)
data=transpose([[x],[y],[z]])
centroid=total(data,2)/n

data[0,*]-=centroid[0]
data[1,*]-=centroid[1]
data[2,*]-=centroid[2]

SVDC, data, W, U, V

smallest_singularvalue=min(W,ind)
plane_normal=reform(V[ind,*])

print,'Orthogonal distance regression plane'
print,'1. goes through: ',centroid
print,'2. has normal: ',plane_normal
end;pro test
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: map_set problem
Next Topic: find a plane in a 3D plot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:33:20 PDT 2025

Total time taken to generate the page: 0.00515 seconds