对数螺旋 - 被点上的螺旋(笛卡尔坐标 [英] Logarithmic Spiral - Is Point on Spiral (cartesian coordinates

查看:251
本文介绍了对数螺旋 - 被点上的螺旋(笛卡尔坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说我有一个3D笛卡尔网格。让我们还假设有从在水平面上的原点发出一个或多个日志螺旋

Lets Say I have a 3d Cartesian grid. Lets also assume that there are one or more log spirals emanating from the origin on the horizontal plane.

如果我然后在网格中的点我想如果测试点是在螺旋中的一个。我实际上可以想一定范围内螺旋线内,如果它来测试,但确定它是在该点是一个好的开始。

If I then have a point in the grid I want to test if that point is in one of the spirals. I acutally want to test if it within a certain range of the spirals but determining if it is on the point is a good start.

所以我想这个问题有几个部分。

So I guess the question has a couple parts.


  1. 如何从参数武器(方向,气密性)

  1. How to generate the arms from parameters (direction, tightness)

如何判断是否在网格中的一个点是在螺旋臂中的一个

How to tell if a point in the grid is in one of the spiral arms

有任何想法吗?我一直在谷歌上搜索了一整天,也不觉得我更接近比当我开始一个解决方案

Any ideas? I have been googling all day and don't feel I am any closer to a solution than when I started.

下面是一个位的更多信息,可以帮助:

Here is a bit more information that might help:

我实际上并不需要渲染的螺旋。我想设置俯仰和旋转,然后通过一个点,可以告诉我,如果我通过了点螺旋内(上螺旋任何一点的给定范围内)的方法。根据返回的值(true或false)我的计划将作出是否存在在空间中的点东西的决定。

I don't actually need to render the spirals. I want to set the pitch and rotation and then pass a point to a method that can tell me if the point I passed is within the spiral (within a given range of any point on the spiral). Based on the value returned (true or false) my program will make a decision on whether or not something exists at the point in space.


  1. 如何参定义日志螺旋(俯仰和旋转和?)

  1. How to parametrically define the log spirals (pitch and rotation and ??)

测试一个点(x,Y,Z)被withing上螺旋任何点的给定范围内。

Test if a point (x, y, z) is withing a given range of any point on the spiral.

请注意:上述两种将只是在水平面上

Note: Both of the above would be just on the horizontal plane

推荐答案

这是两个函数定义一个逆时针螺旋:

These are two functions defining an anti-clockwise spiral:

PolarPlot[{

  Exp[(t + 10)/100],
  Exp[t/100]},

 {t, 0, 100 Pi}]

输出:

这是定义顺时针螺旋形两种功能:

These are two functions defining a clockwise spiral:

PolarPlot[{

 - Exp[(t + 10)/100],
 - Exp[t/100]},

 {t, 0, 100 Pi}]

输出:

笛卡尔坐标

转换笛卡尔< - >极地是

The conversion Cartesian <-> Polar is

  (1)  Ro = Sqrt[x^2+y^2] 
        t = ArcTan[y/x]

  (2)  x  = Ro Cos[t]
       y  = Ro Sin[t]  

所以,如果你有一个点在直角COORDS(X,Y )在使用(1)将其转换为等值的极坐标。然后你使用forula为螺旋功能(任意的四个地块,或类似的上述mentinoned的)把在那里的值T,并获得罗。最后一步是将本滚装与我们从坐标converion得到一个比较。如果他们是平等的,关键是在螺旋上升。

So, If you have a point in Cartesian Coords (x,y) you transform it to your equivalent polar coordinates using (1). Then you use the forula for the spiral function (any of the four mentinoned above the plots, or similar ones) putting in there the value for t, and obtaining Ro. The last step is to compare this Ro with the one we got from the coordinates converion. If they are equal, the point is on the spiral.

修改回答您的评论

有关日志的螺旋是几乎相同的,但具有多个螺旋需要采取日志不会负值的照顾。这就是为什么我用指数函数...

For a Log spiral is almost the same, but with multiple spirals you need to take care of the logs not going to negative values. That's why I used exponentials ...

例如:

PolarPlot[{

  Log[t],
  If[t > 3, Log[ t - 2], 0],
  If[t > 5, Log[ t - 4], 0]

}, {t, 1, 10}]

输出:

这篇关于对数螺旋 - 被点上的螺旋(笛卡尔坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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