Complex sho(d3vec r,double k)Return value:
- sho: Value of the potential energy from a three-dimensional spring -
![]()
Input:
- k: spring constant
- r: d3vec with components r.x, r.y, r.z
In the next problem, we will solve for the ground state of the simple harmonic oscillator. Provide the above function (not as part of the pvector class definition!) to your program so that it may be used with evalr() in your main() program to create the potential pvector V.