On which side of the vector on graph is the origin? [Geometry]

I have a vector on a graph. The position of the vector on the graph is known. The vector value is normalized and is known. If the graph is divided along the vector’s position and direction, on which side is the origin, left or right?

float x = someValue;
float y = otherValue;
Vector2 vector = someVector.normalized;

// Find:
bool originIsOnRight;

Given these variables, how to calculate originIsOnRight?

The way you specify your input variables is very confusing. First of all a 2d vector is just a pair of two numbers (x and y). So the given values are actually two vectors. One that specify the point (x,y) and one that specify the direction you’re interested in. Next keep in mind that vectors themselfs do not have a position. This is all just interpretation. Technically all vectors (whether they are positions or directions) start at the origin. It doesn’t have to be the world origin and could be any space they belong to. However this information is not part of the vector itself.

About your issue: All you have to do is check the dot product between the vector from the origin to your point and the perpendicular of your vector / direction. This will tell you if the (world) origin is to the left or right. You get the perpendicular of a 2d vector by simply swapping it’s coordinates and negate one of them. Which you negate will determine if you rotate 90° clockwise or counter clockwise.

For example:

Vector2 p; // our point (x,y)
Vector2 d; // our direction "vector"

Vector2 normal = new Vector2(-d.y, d.x); // clockwise rotation
float dot = Vector2.Dot(p, normal);
if (dot > 0)
{
    // the origin is to the left of vector
}
else if (dot < 0)
{
    // the origin is to the right of vector
}
else
{
    // the vector passes through the origin
}

Are you sure this is actually a game development question? This sounds more like a school geometry question. I’ve moved the question into the help room since it’s not really Unity related.