Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

What is ub variable used for? #9

Closed
garfi43 opened this Issue · 3 comments

2 participants

@garfi43

I wanted to know what is the following variable used for.

File ray2.c on line 31:

  • 31: kmScalar ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denom;

It is declared and initialized but never used.

on lines 33,34

  • 33: kmScalar x = x1 + ua * (x2 - x1);
  • 34: kmScalar y = y1 + ua * (y2 - y1);

ua variable is used two times.

Was the ua variable on line 34 meant to be ub?

@Kazade
Owner

No, the double usage of ua is correct. However, ua and ub can be used to determine if the intersection actually happened which is what we should be doing rather than the min/max checks. I'll take a proper look when I can :)

@garfi43

Thank you for your reply. Really nice library.

@Kazade
Owner

I finally fixed this. Latest master makes use of ub.

@Kazade Kazade closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.