4kbt / NewtonianEotWashToolkit

A simple point-wise Newtonian gravitational force calculator
GNU General Public License v3.0
6 stars 2 forks source link

annulus can yield zero moments instead of an error #23

Closed 4kbt closed 4 years ago

4kbt commented 4 years ago

qlm.annulus(2,2,2,0,2,4,4)

returns

[[0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j] [0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j] [0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j]]

I believe that the final 4,4 should yield an error, as it is an annulus centered at 4 radians that spans \pm 4 radians, which is unphysical.

JGLee6 commented 4 years ago

This is a good point. Many of the moments for various shapes can receive un-physical values and perform some checks but just return the empty array. We'll have to go through and see which ones have these possible inputs, but a better method would be: Raise ValueError('Unphysical input parameter)