test code
const res = calculateElbow(
{
x: -2.025,
y: 2.000000000000001,
facingDirection: "y+",
},
{
x: -1.1099999999999999,
y: 2.0000000000000018,
facingDirection: "x-",
},
{
overshoot: 0.2,
},
)
console.log(JSON.stringify(res, null, 2))
bun and nodejs
[
{
"x": -2.025,
"y": 2.000000000000001
},
{
"x": -2.025,
"y": 2.200000000000001
},
{
"x": -1.3099999999999998,
"y": 2.200000000000001
},
{
"x": -1.3099999999999998,
"y": 2.0000000000000018
},
{
"x": -1.1099999999999999,
"y": 2.0000000000000018
}
]
chrome and firefox
[
{
"x": -2.025,
"y": 2.000000000000001
},
{
"x": -2.025,
"y": 2.0000000000000018
},
{
"x": -1.1099999999999999,
"y": 2.0000000000000018
}
]
test code
bun and nodejs
chrome and firefox