Support Vector

Started by
10 comments, last by alvaro 10 years ago

@Javier - The X and Y are the x and y ordinates of a Vector2, this is c#, not c++, so a Vector is a geometric vector, not an array, or anything like that.

Editing your posted code and then criticizing a previous response is bad style. Your original post did not define X or Y or provide any context.

Sorry if it sounded like a criticism, I didn't mean it as a criticism. I meant it as a clarification. And i edited the question to clarify what X and Y are. Though I can see that such an edit then degrades the clarity of the conversation.

Advertisement

Hi,

Is the following function for a support vector correct?


class Vector2
{
     public Vector2 SupportVector()
     {
         if (Math.Abs(X) > Math.Abs(Y))
             return new Vector2(X, 0);
         else
             return new Vector2(0, Y);
     }
}

I would call that function something like `LongestProjectionToCoordinateAxis'.

This topic is closed to new replies.

Advertisement