How to rotate Vector3 to EulerAngle?

I have a plane, defined by three points. For example:

  • O = Vector3.zero
  • A = Vector3(3,15,5)
  • B = Vector3(2,4,10)

I need to find fourth point var D : Vector3, knowing that point lies in the same plane, distance from A is 10 units and angle between my new point D and A from B (angle DBA) is 40 Euler degrees (in the direction of O).

Not really a Unity question, but here is an outline of one method:

  • From the triangle ABD, you have two sides and an angle, so you can get angle BAD.
  • Use A as an origin, create a vector AB normalized * 10
  • To get an axis, use A as an origin, and create an axis by AB cross AO
  • Use Angle Axis rotation with the calculated axis and calculated angle
  • Add back A to get point