Renamed coordinate to coord
Revised comments
Removed #include <iostream> and replaced 0.5f by 0.5
Renamed type_pair_index to p_offset
Renamed (t1, t2) to (t0, t1)