How to get the center of a polyline


Is there any formula or method to get the center of the polyline?
Basically I have 2 cartesian3 and I want to get the center of it.


Was able to get what I need through this.


Provide an idea:

  1. Calculate their distance and total distance.
  2. Calculate the half of total distance then you will know which cartesain the midpoint is on.
  3. Use Cartesian3.lerp() to get midpoint position.