Johnson's Distance Algorithm: What am I doing wrong?

Please don't post Bullet support questions here, use the above forums instead.
Adrian Lopez
Posts: 10
Joined: Thu Jan 21, 2010 7:07 pm

Johnson's Distance Algorithm: What am I doing wrong?

Post by Adrian Lopez »

Given a simplex {y1, y2} where:

y1 = (1,-1)
y2 = (1,1)

The closest point of its affine hull to the origin should be (1, 0), but that's not what I get:

Δ1 = 1
Δ2 = Δ1 * ((y1 - y2) . y1) = 2
Δx = Δ1 + Δ2 = 3

λ1 = Δ1/Δx = 1/3
λ2 = Δ2/Δx = 2/3

v = λ1*y1 + λ2*y2 = (1, 1/3)

I must be doing something wrong, but I can't figure out what that is.
Adrian Lopez
Posts: 10
Joined: Thu Jan 21, 2010 7:07 pm

Re: Johnson's Distance Algorithm: What am I doing wrong?

Post by Adrian Lopez »

I'm also asking on Stack Overflow.