draw line between two objects and track distance between them code example
Example 1: Getting the differences between two objects javascript lib
import { transform, isEqual, isObject } from 'lodash';
function difference(object, base) {
return transform(object, (result, value, key) => {
if (!isEqual(value, base[key])) {
result[key] = isObject(value) && isObject(base[key]) ? difference(value, base[key]) : value;
}
});
}
Example 2: get all coordinates between two points
(x - 10) / (y - 5) = (15 - 10) / (90 - 5)