<p dir="ltr">Hi.<br>
This looks more like a C# question, and I am not a C# expert at all.<br>
However, you may want to take a look here:</p>
<p dir="ltr"><a href="http://msdn.microsoft.com/it-it/library/ms146627.aspx">http://msdn.microsoft.com/it-it/library/ms146627.aspx</a></p>
<p dir="ltr">Having said this, computing the dot product between two vectors and their modulus is so simple that you probably may prefer to compute them directly from your C# code, especially if marshalling of parameters to call a VTK method is complex.</p>
<p dir="ltr">Regards,</p>
<p dir="ltr">Marco<br>
</p>
<div class="gmail_quote">Il giorno 23/apr/2013 06:39, "Arindam" <<a href="mailto:arindam@triassicsolutions.com">arindam@triassicsolutions.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Thanks for your reply.I already tried
and i got the angle by this.but i was getting one issue
here.vtkMath is having a method called <a href="http://www.vtk.org/doc/release/5.0/html/a01710.html#z331_0" target="_blank">Dot</a>
(const double x[3], const double y[3]) and <a href="http://www.vtk.org/doc/release/5.0/html/a01710.html#z333_0" target="_blank">Norm</a>
(const float x[3]) in c++.but i was doing my application in
c#.Where this two method prototype is like Dot(IntPtr X,Intptr Y)
and Norm(Intptr X) . How can we convert it?Please help.<br>
<br>
On 4/22/2013 8:35 PM, Marco Nawijn wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>As the other Marco already mentioned, you need at least
three points (or 2 vectors) to calculate the angle between
them.</div>
<div>If you have them, you can simply apply the cosine rule
which states (in words):</div>
<div>the cosine of the angle between two vectors is the dot
product of the vectors divided by the their lengths
multiplied.</div>
<div>so in math:</div>
<div> dot(a,b)</div>
<div> cos(angle) = -----------</div>
<div> norm(a)*norm(b)</div>
<div> </div>
<div>I have not checked it, but I guess vtk will have buildin
functions for calculating dot (or inner) products and norms.</div>
<div>Take a look at the functionality provided in the vtkMath
library.</div>
<div> </div>
<div>Kind regards,</div>
<div> </div>
<div>(another) Marco</div>
<div> </div>
<div> </div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Apr 22, 2013 at 10:23 AM, Marco
Sambin <span dir="ltr"><<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi.
<div>In order to define an angle, you will need at least
THREE points. Is the third point the origin (0,0,0) in
your case?</div>
<div>I guess you will need to identify the plane
"containing" those three points, and then you will be
able to compute the angle on that plane, in a "2D
fashion".</div>
<div>Regards,</div>
<div><br>
</div>
<div>Marco</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>On Mon, Apr 22, 2013 at 10:19 AM,
Arindam <span dir="ltr"><<a href="mailto:arindam@triassicsolutions.com" target="_blank">arindam@triassicsolutions.com</a>></span>
wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
<div>
<div text="#000000" bgcolor="#FFFFFF"> <font color="#33cc00"><font><font face="calibri,sans
serif,arial"><font color="#000000">Hi<font>,<br>
<br>
<font>I want to calculate angle<font>
between two 3D points.Suppose the
points are (5,5,5)</font></font> and
(1,2,3). For 2D points i know how can i
do this.But for 3D points i need help
from some one.Any help will be
appreciated.<br>
</font></font></font></font></font> </div>
<br>
</div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ
at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
</blockquote>
<br>
<br>
<div><font color="#262626" face="calibri,sans
serif,arial">
<div>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td colspan="2" valign="top" width="230"><br>
</td>
</tr>
<tr>
<td valign="top" width="100%"><br>
</td>
</tr>
<tr>
<td><br>
</td>
</tr>
</tbody>
</table>
</div>
</font></div>
</div>
</blockquote></div>