确定3D空间中直线的角度 [英] Determine angle of a straight line in 3D space

查看:87
本文介绍了确定3D空间中直线的角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在空间中有一条直线,有一个起点和终点(x,y,z),我试图获得角度,但我无法弄清楚这个公式。我正在使用VB.NET



这是我的3D环境中的线条图片(以红色圈出的线条)



如果有人可以提供帮助,我们将不胜感激。再次,我有起点和终点的值(x,y,z)



现在设置为70度的角度。

I have a straight line in space with an start and end point (x,y,z) and I am attempting to get the angle but I cannot figure out the formula for this. I am using VB.NET

Here is a picture of the line in my 3d environment (the one that is circled in red)

If someone can help, it would be appreciated. Again, i have the values of the start and end points (x,y,z)

It is set to an angle of 70 degrees right now.

推荐答案

Dim x, y, z As Double

        x = EndPoint.X - StartPoint.X
        y = EndPoint.Y - StartPoint.Y
        z = EndPoint.Z - StartPoint.Z

        'a = arcsin(v.z / sqrt(v.x²+v.y²+v.z²))
        MsgBox((Math.Asin(z / Math.Sqrt((x ^ 2) + (y ^ 2) + (z ^ 2)))) * (180 / Math.PI))







是解决方案。有人在另一个网站上帮助我了!




Is the solution. Someone was kind enough to assist me on another site!


这是一个数学问题,与VB.NET或任何其他语言无关。据我所知,它与两侧的长度,正弦,余弦等有关。
That is a mathematical question, nothing to do with VB.NET, or any other language. As far as I recall it has something to do with the length of the sides, and sines, cosines etc.


这篇关于确定3D空间中直线的角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆