create-expo-cljs-app
Version:
Create a react native application with Expo and Shadow-CLJS!
15 lines (14 loc) • 326 B
JavaScript
/**
* @private
* calculate the velocity between two points. unit is in px per ms.
* @param {Number} deltaTime
* @param {Number} x
* @param {Number} y
* @return {Object} velocity `x` and `y`
*/
export default function getVelocity(deltaTime, x, y) {
return {
x: x / deltaTime || 0,
y: y / deltaTime || 0
};
}