GithubHelp home page GithubHelp logo

Comments (3)

arbv avatar arbv commented on July 25, 2024

Thank you for your interest in Corman Lisp!

I have replied to you in the Google Group. Unfortunately, we do not have an active mailing list or forum yet.

May I ask you to provide some code which demonstrates the problem? It would simplify the investigation.

from cormanlisp.

framlingham avatar framlingham commented on July 25, 2024

Sure thing. This code loops around a unit circle from 0° to 360° in 15° steps. The last two numbers show the starting angle, and the reconstructed angle using atan. This is run on v3.1.2

(loop for ang from 0 to (* 2 pi) by (/ pi 12)
      for deg = (round (* ang (/ 180 pi)))
      for x = (cos ang)
      and y = (sin ang)
      for atan-ang = (atan y x)
      for atan-deg = (round (* atan-ang (/ 180 pi)))
  do (format t "~&Ang = ~,3Fr  pt = (~5,2F, ~5,2F) start deg = ~3D, atan = ~3D~%" ang x y deg atan-deg))
Ang = 0.000r  pt = ( 1.00,  0.00) start deg =   0, atan =   0
Ang = 0.262r  pt = ( 0.97,  0.26) start deg =  15, atan =  15
Ang = 0.524r  pt = ( 0.87,  0.50) start deg =  30, atan =  30
Ang = 0.785r  pt = ( 0.71,  0.71) start deg =  45, atan =  45
Ang = 1.047r  pt = ( 0.50,  0.87) start deg =  60, atan =  60
Ang = 1.309r  pt = ( 0.26,  0.97) start deg =  75, atan =  75
Ang = 1.571r  pt = ( 0.00,  1.00) start deg =  90, atan =  90
Ang = 1.833r  pt = (-0.26,  0.97) start deg = 105, atan = -75
Ang = 2.094r  pt = (-0.50,  0.87) start deg = 120, atan = -60
Ang = 2.356r  pt = (-0.71,  0.71) start deg = 135, atan = -45
Ang = 2.618r  pt = (-0.87,  0.50) start deg = 150, atan = -30
Ang = 2.880r  pt = (-0.97,  0.26) start deg = 165, atan = -15
Ang = 3.142r  pt = (-1.00, -0.00) start deg = 180, atan =   0
Ang = 3.403r  pt = (-0.97, -0.26) start deg = 195, atan =  15
Ang = 3.665r  pt = (-0.87, -0.50) start deg = 210, atan =  30
Ang = 3.927r  pt = (-0.71, -0.71) start deg = 225, atan =  45
Ang = 4.189r  pt = (-0.50, -0.87) start deg = 240, atan =  60
Ang = 4.451r  pt = (-0.26, -0.97) start deg = 255, atan =  75
Ang = 4.712r  pt = (-0.00, -1.00) start deg = 270, atan =  90
Ang = 4.974r  pt = ( 0.26, -0.97) start deg = 285, atan = -75
Ang = 5.236r  pt = ( 0.50, -0.87) start deg = 300, atan = -60
Ang = 5.498r  pt = ( 0.71, -0.71) start deg = 315, atan = -45
Ang = 5.760r  pt = ( 0.87, -0.50) start deg = 330, atan = -30
Ang = 6.021r  pt = ( 0.97, -0.26) start deg = 345, atan = -15
Ang = 6.283r  pt = ( 1.00, -0.00) start deg = 360, atan =   0
NIL

The existing atan only works in the first quadrant (and fourth quadrant I suppose), and I think needs updating like in my diff. In developing the suggested code, I generated output and compared it to other calculations, like Excel's atan2. I found that if I wasn't careful, I got an inconsistent shape of the atan graph.

from cormanlisp.

arbv avatar arbv commented on July 25, 2024

Thanks, that is a good catch. With your fix Corman Lisp produces the same results as SBCL.

from cormanlisp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.