All things are lawful, but not all things are profitable.
Guillermo Ishi wrote:Do you just need to get from point A to point B? I would just do it this way  if point A is (27,93) and point B was (15,105) I would make my first move to (26,94) then to (25,95) and so on. You could make up some proportionality function to make it approximate a straight line better if you needed to. The slick geometric way would be to make the two points the hypotenuse of a right triangle, and at that point you could beat on it with trig functions.
Lora Twinblade wrote:
As I understand it, if I wish for a object to travel from the starting point of locationX, locationY I would do so by advancing with:
However, the actual result appears to be quite random...
Henry Wong wrote:
Lora Twinblade wrote:
As I understand it, if I wish for a object to travel from the starting point of locationX, locationY I would do so by advancing with:
However, the actual result appears to be quite random...
First, welcome to the ranch.
You have two possible issues. One. Sine and Cosine are ratios, so to get exact values, you will need to multiply it with the length between those two points. Two. The sin() and cos() methods takes radians. You converted it to degrees. So, you need to convert it back to radians, or better yet, don't convert it to degrees in the first place.
Henry
He's giving us the slip! Quick! Grab this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filleradvertising
