select
    id,
    location_timestamp,
    latitude,
    longitude,
    lag(latitude)
        over (partition by person_id order by location_timestamp) 
        as previous_latitude,
    lag(longitude)
        over (partition by person_id order by location_timestamp) 
        as previous_longitude
from
    track
where
    person_id = 21736;