# Rendering asteroid orientation as seen from Earth

I am writing a program to render an asteroid as seen from various parts of the solar system. My goal is to roughly reproduce the image of Cacus according to information on its DAMIT detail page.

Here is my approach:

1. Create a solar system at JD0=2443568.0. The axes of the visualization are arranged according to the ecliptic with positive X axis in the direction of the vernal equinox and other axes according to the right-hand rule. Earth is positioned at t=JD0. (image)

2. Place the asteroid at (0, 0, 0) and begin to rotate the object according to the matrix multiplication described by the Description page and Kaasalainen & Torppa 2001:

• φ0=0 and t=JD0, so there is no initial Z axis rotation

• Latitude β is -63, so rotate 90 - (-63) = 153 degrees on the Y axis (image)

• Longitude λ is 251, so rotate the object 251 degrees anticlockwise around the Z axis of the ecliptic (image)

3. Using ephemeris from the NASA/JPL Small Body Database, move Cacus to its position in orbit at JD0. (image)

4. Move the camera to Earth's position at JD0 and point it at the asteroid. (image)

My final rendering does not match the projection from DAMIT. I understand that there are factors like light-time correction that I'm not including, but it looks completely different.

What is wrong with my approach to rotating the asteroid on its spin axis? (The work-in-progress visualization is online here)

• Obvious questions first: Did you convert the $\beta$ and $\lambda$ angles to radians before attempting to use them in a rotation matrix? – cms Feb 13 '19 at 16:50
• I am indeed converting the angles to radians – ty. Feb 13 '19 at 20:13
• How are you determining where the Earth is at jd0? – cms Feb 13 '19 at 21:16
• @cms If you are willing to read code, here is the function I wrote to compute heliocentric coords from ephemeris: gist.github.com/typpo/e20da5a9976edd28511240b9248f00fe I am using ephem for EM Barycenter from ssd.jpl.nasa.gov/?planet_pos – ty. Feb 15 '19 at 1:00
• @cms I've detailed my process for heliocentric position here: astronomy.stackexchange.com/questions/29575/… – ty. Feb 20 '19 at 1:19

$$\vec r_{ast} = R_z(\omega(t-t_0)+\phi_0) R_y(\hat\beta) R_z(\lambda) \vec r_{ecl}$$
To reverse this equation you must reverse the order of the rotations and the rotation angles: $$\vec r_{ecl} = R_z(-\lambda)R_y(-\hat\beta)R_z(-\omega(t-t_0)-\phi_0) \vec r_{ast}$$