I have an entity that is allowed to move in a fixed amount of directions. Let's call a the angle between two directions. r is the length of each direction vector. Now the entity wants to head from its current position (x1,y1) to a target (x2,y2) in one of the fixed directions. Instead of getting the direction that the entity should head into, I want to get a weight for all directions that is based on how close the entity gets to the target with that direction, so that I can combine those weights with other things like avoiding some direction for example.
I thought about calculating the distance from the new positions to the target and then use the closest distance (the one in which the entity heads in the direction directly to the target) to get a weighting from 1 to zero for the other directions.
Now I was wondering if there is some other way to get the weights without having to calculate the distance for each direction. Maybe there is some sort of relation between the angle from the ideal direction and the distance that could be used to calculate the weights instead? So far I've figured out that at least there is no no linear relation between the angle and the distance.