Hi @Dallas3726,
Welcome to the RStudio Community Forum.
Your question sounds a lot like "home-work"! You should read the posting guide to this forum, and try to post some code that you have written that attempts to solve your problem (but perhaps fails for some reason that you can't work out).
Here are some steps you could follow:
- Create some dummy data in a data.frame that represent your points (hint: 4 columns).
- Do some trigonometry calculations on those numbers to find the distances.
- When that code is working, convert it into a simple user-defined function.