You can also establish a coordinate system, with A as the origin, the straight line where AB is located as the X axis, then A (0,0) B (0, 10), and then establish an equation according to the conditions to get the trajectory of P.
There are many ways to establish it, but in general, the exercises in senior high school are all established in this way, because the curves involved in senior high school, such as ellipses and hyperbolas, have their center points on the X axis and are symmetrical. In some problems, if it is divided into several problems, the equation obtained is convenient to solve the later problems.