Regarding Boost.Astronomy GSoC19
Hello, For the competency test I had used quantity<length> of boost::units in place of double to store the values of coordinates with their units. But in project we have to deal with boost::geometry. One way it can be done is that whenever we use functions for dot product, cross product, etc. directly from boost::geometry then we just pass the values of coordinates in them instead of units. There will be no problem considering units in calculations as boost::units convert the values stored into SI units so all the calculations will be involving coordinates with SI units. But then we will have to change the way of storage of coordinates as boost::geometry can't be used to store coordinates(with units) as it does not support units. Is it the right approach or there is some nicer way to implement this? Thank you, Sarthak Singhal -- Sent from: http://boost.2283326.n4.nabble.com/Boost-Dev-f2600599.html
On Thu, Apr 4, 2019 at 7:45 PM sarthak2007 via Boost
One way it can be done is that whenever we use functions for dot product, cross product, etc. directly from boost::geometry then we just pass the values of coordinates in them instead of units.
Yes, this is how it will be done.
There will be no problem considering units in calculations as boost::units convert the values stored into SI units so all the calculations will be involving coordinates with SI units. But then we will have to change the way of storage of coordinates as boost::geometry can't be used to store coordinates(with units) as it does not support units. Is it the right approach or there is some nicer way to implement this?
It is not as simple as it sounds. Most of the times astronomical systems does not use metric units but units like Astronomical unit, Light-year, and Parsec so you'll be not able to use units prefix directly. Storing it in SI and every time converting when data is requested would be time-consuming. Solution to this would be using TMP but it will require many compile-time checkings for units. There are other challenges like spherical coordinate system would require handling for multiple units because two coordinates will be angle while one coordinate will be the length. It sounds simple but when you implement it is complicated and requires too much testing as it uses TMP. -- Thank you, Ruchika Joshi
participants (2)
-
Ruchika Joshi
-
sarthak2007