diff --git a/html/images/space.svg b/html/images/space.svg
index 124a817..e9e9bf4 100644
--- a/html/images/space.svg
+++ b/html/images/space.svg
@@ -126,7 +126,6 @@
-
@@ -572,18 +571,21 @@ const Move = (() => {
console.log("theta between edge vector and velocity vector", edgeTheta, "degrees", edgeTheta * 180 / Math.PI);
console.log("theta between normal vector and velocity vector", normalTheta, "degrees", normalTheta * 180 / Math.PI);
+ const newTheta = (Math.PI - normalTheta) * 2;
+ const newY = -Math.cos(newTheta) * velocityVectorMagnitude;
+ const newX = Math.sin(newTheta) * velocityVectorMagnitude;
Velocity[entity_id] = {
// x: v.x * Math.sin(thetaX) + v.y * Math.cos(thetaY),
// y: v.y * Math.sin(thetaY) + v.x * Math.cos(thetaX)
- x: v.y,
+ x: newX,
// y: v.y * Math.sin(thetaY) + v.x * Math.cos(thetaX)
- y: 0
+ y: newY
};
console.log("VELOCITY AFTER", Velocity[entity_id]);
- Position[entity_id] = { x: p.x, y: p.y };
+ // Position[entity_id] = { x: p.x, y: p.y };
// console.log("contact", contact.edge);
// Position[entity_id] = contact.position;
} else {