Logarithmic Spiral - Is Point on Spiral (cartesian coordinates

前端 未结 4 1307
囚心锁ツ
囚心锁ツ 2021-01-26 13:14

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

4条回答
  •  悲&欢浪女
    2021-01-26 13:27

    These are two functions defining an anti-clockwise spiral:

    PolarPlot[{
    
      Exp[(t + 10)/100],
      Exp[t/100]},
    
     {t, 0, 100 Pi}]
    

    Output:

    alt text

    These are two functions defining a clockwise spiral:

    PolarPlot[{
    
     - Exp[(t + 10)/100],
     - Exp[t/100]},
    
     {t, 0, 100 Pi}]
    

    Output:

    alt text

    Cartesian coordinates

    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]  
    

    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.

    Edit Answering your comment

    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 ...

    Example:

    PolarPlot[{
    
      Log[t],
      If[t > 3, Log[ t - 2], 0],
      If[t > 5, Log[ t - 4], 0]
    
    }, {t, 1, 10}]
    

    Output:

    alt text

提交回复
热议问题