8th commit - minor changes

[change] direction method:
- recoded to avoid issues with line gradient values
[change] perpendicularLine method:
- recoded to avoid issues with line gradient values