Code Monkey home page Code Monkey logo

alhazen-ptolemy's Introduction

Alhazen-Ptolemy

The most up-to-date version of the associated paper, entitled Solving the Alhazen-Ptolemy Problem: Determining Specular Points on Spherical Surfaces for Radiative Transfer of Titan's Seas, can be found here.

Implementations of the solutions for determining the specular point on a spherical surface given an arbitrary spatial configuration of source and observer (known as the Alhazen-Ptolemy problem).

Alhazen-Ptolemy.c++ has three use modes: benchmarking, one-finite, and both-finite.

The benchmarking usage is

alhazen-ptolemy

The one-finite usage is

alhazen-ptolemy <observer_angle> <c>

And the both-finite usage is

alhazen-ptolemy <observer_angle> <c> <b>

observer_angle corresponds to θobs from the paper (or θsrc, if the observer was rotated to π / 2 instead). Note that the branch-deductions assume the point with the smaller radius has been rotated to π / 2. observer_angle is specified in degrees as the angle from the positive x-axis. b is the ratio between the radius of the sphere and the radius of either the observer or the source -- whichever is larger -- and c is the other ratio. In the associated paper, b is the ratio between the radius of the sphere and the radius of the observer, i.e. Rsph / Robs, and c is the ratio between the radius of the sphere and the radius of the source, i.e. Rsph / Rsrc.

alhazenptolemy.py has the same usage as Alhazen-Ptolemy.c++ except it does not feature any benchmarking. This directory is also an installable python module. Installing with

python -m pip install Alhazen-Ptolemy

or

pip install Alhazen-Ptolemy

will make the alhazenptolemy.py module importable via

import alhazenptolemy

alhazen-ptolemy's People

Contributors

wmiller256 avatar

Stargazers

Zuhayer Mahtab avatar Yang avatar  avatar

Watchers

James Cloos avatar  avatar

alhazen-ptolemy's Issues

Suspected mistakes in the documentation and the paper

I believe the definitions of c and b are reversed in the README, owing to the fact that in definitions:

t1 = np.arctan2(b * np.sin(obs) - rt * np.sin(spec), b * np.cos(obs) - rt * np.cos(spec))
t2 = np.arctan2(c * np.sin(src) - rt * np.sin(spec), c * np.cos(src) - rt * np.cos(spec))

the angles t1 and t2 correspond to the angles from the specular point to the observer/source, where b must correspond to the radius to the observer, and c to the radius of the source.

This same mistake (mixing up Rsrc and Robs) seems to be present in https://arxiv.org/pdf/2012.02170.pdf equation 17 on page 6 (I don't know if this is the latest revision of the paper or if it was subsequently corrected)

The definitions in the C code comments appear to be correct, although I did not test the C implementation.

As an aside, I also find disagreement between numerical and branchdeducing_twofinite for the inputs:
obs=-0.2989068116739271 c=0.3380059593586045 b=0.21900854161140168 although this seems like a deeper issue. The 3rd branch is chosen but the numerical solution agrees with the second branch.

Possible error in branchdeducing_twofinite

In your paper, the E6 coefficient denominator is 16E5, but in the python code it is 4E5. Similarly in the calculation of E7, the first 2 terms are different from the paper, with the code using b2c_obs2/2 - E0/3 and in the paper this is 3(bcos theta_obs)^2 / 12 - 2E0/12.

Am I missing something in the algebra? E4 in the code matches your paper.

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.