Created
June 15, 2018 13:03
-
-
Save kim366/5ac190f257d1407d20ad88631f92ef25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sf::Vector2f put_point_on_line(sf::Vector2f point, sf::Vector2f line_point0, sf::Vector2f line_point1) | |
{ | |
const sf::Vector2f line_seg{line_point1 - line_point0}; | |
return line_point1 + unitV(line_seg) * dot(unitV(line_seg), point - line_point1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment