I am trying to calculate the angle between two vectors. There is such code:

public double Calculate_Angel(Vector2 car_vector, Vector2 end_point_vector) { double angle = Vector2.AngleBetween(car_vector, end_point_vector); return angle; } 

An error:

Error CS0117 "Vector2" does not contain a definition for "AngleBetween".

How to be?

  • And what to try - in the last branch I gave the formula. - MBo
  • What is Vector2 ? What library is this type from? Datnet has a System.Numerics.Vector2 structure, but it does not have the AngleBetween method. This method is in the System.Windows.Vector structure. Please note that they are in different assemblies. - Alexander Petrov

0