Repository: sympy/sympy
Pull request: Updated docstrings of Reference Frames and Points to show multiple instances
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->
Fixes #17760 

#### Brief description of what is fixed or changed
Included examples in the doctrings of Reference Frames and Points to show how to create multiple instances using `sympy.symbols`

#### Other comments
The specific examples added are:

 **frame.py**
```
 >>> B, C = symbols('B C', cls=ReferenceFrame, indices=('1', '2', '3'))
>>> B[0]
B_x
>>> type(A[0])
<class 'sympy.physics.vector.frame.CoordinateSym'>
>>> type(A[0]) == type(B[0])
True
>>> B.indices
(1, 2, 3)
```

**point.py**
```
>>> a,b = symbols('a b', cls=Point)
>>> type(a)
<class 'sympy.physics.vector.point.Point'>
>>> x = Point('X')
>>> type(a) == type(x)
True
```

#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
NO ENTRY
<!-- END RELEASE NOTES -->


Problem statement:
update docstrings to show how to create many reference frames (and points)
It is common to do:

```
from sympy.physics.vector import ReferenceFrame
A = ReferenceFrame('A')
B = ReferenceFrame('B')
C = ReferenceFrame('C')
D = ReferenceFrame('D')
```

It would be nice to do:

```
A, B, C, D = reference_frames('A, B, C, D')
```

like `sympy.symbols()`. It would need to support setting the options for the frames too.

Same goes for `sympy.physics.vector.Point()`.

Hints from issue discussion:
```python
>>> from sympy.physics.vector import ReferenceFrame, Point
>>> A,B = symbols('A B', cls=ReferenceFrame)
>>> a,b = symbols('a b', cls=Point)
```

What options do you want to set?
Oh, yes, I forgot about that!

The `__init__` method of ReferenceFrame has several optional parameters. Point may also.
```python
>>> from sympy.physics.vector import ReferenceFrame, Point
... A,B = symbols('A B', cls=ReferenceFrame, indices=('1', '2', '3'))
>>> A.indices
(1, 2, 3)
```
Great. Gonna leave this open until I (or someone) adds this to the documentation as an example.
Hi @moorepants , I've submitted a PR that updates the doctrings, as you said. Please do have a look at it!

Commit message: Updates Point docstring with initialization examples

Patch to review:
diff --git a/sympy/physics/vector/frame.py b/sympy/physics/vector/frame.py
index 8bd6011e14df..00c2fceb24fe 100644
--- a/sympy/physics/vector/frame.py
+++ b/sympy/physics/vector/frame.py
@@ -89,6 +89,8 @@ class ReferenceFrame(object):
     the parent frame's basis vectors.  It can also have an angular velocity
     vector, defined in another frame.
 
+
+
     """
     _count = 0
 
@@ -127,6 +129,22 @@ def __init__(self, name, indices=None, latexs=None, variables=None):
         >>> vlatex(P.x)
         'A1'
 
+
+        Example to create multiple ReferenceFrames:
+
+        >>> from sympy.physics.vector import ReferenceFrame, CoordinateSym
+        >>> from sympy import symbols
+        >>> A, B, C = symbols('A B C', cls=ReferenceFrame)
+        >>> D, E = symbols('D E', cls=ReferenceFrame, indices=('1', '2', '3'))
+        >>> A[0]
+        A_x
+        >>> D.x
+        D['1']
+        >>> E.y
+        E['2']
+        >>> type(A) == type(D)
+        True
+
         """
 
         if not isinstance(name, string_types):
diff --git a/sympy/physics/vector/point.py b/sympy/physics/vector/point.py
index 4a1bb92ba321..03a19bb6a1e5 100644
--- a/sympy/physics/vector/point.py
+++ b/sympy/physics/vector/point.py
@@ -13,6 +13,40 @@ class Point(object):
     The position is a vector defined as the vector distance from a parent
     point to this point.
 
+    Parameters
+    ==========
+
+    name : string
+        The display name of the Point
+
+    Examples
+    ========
+
+    >>> from sympy.physics.vector import Point, ReferenceFrame
+    >>> N = ReferenceFrame('N')
+    >>> O = Point('O')
+    >>> P = Point('P')
+    >>> O.set_vel(N, 10 * N.x + 20 * N.y + 30 * N.z)
+    >>> O.set_acc(N, 7 * N.x + 14 * N.y)
+    >>> O.vel(N)
+    10*N.x + 20*N.y + 30*N.z
+    >>> O.acc(N)
+    7*N.x + 14*N.y
+
+    Example to create multiple Points:
+
+    >>> from sympy.physics.vector import Point, ReferenceFrame
+    >>> from sympy import symbols
+    >>> N = ReferenceFrame('N')
+    >>> A, B = symbols('A B', cls=Point)
+    >>> type(A)
+    <class 'sympy.physics.vector.point.Point'>
+    >>> A.set_acc(N, 30 * N.x + 70 * N.y)
+    >>> B.set_acc(N, 10 * N.x + 50 * N.y)
+    >>> A.acc(N) - B.acc(N)
+    20*N.x + 20*N.y
+
+
     """
 
     def __init__(self, name):


Code review comments:
diff_hunk: @@ -127,6 +129,22 @@ def __init__(self, name, indices=None, latexs=None, variables=None):
         >>> vlatex(P.x)
         'A1'
 
+
+        Example to create multiple ReferenceFrames:
+
+        >>> from sympy.physics.vector import ReferenceFrame, CoordinateSym
path: sympy/physics/vector/frame.py
text: @user1:
Don't import CoordinateSym

diff_hunk: @@ -13,6 +13,40 @@ class Point(object):
     The position is a vector defined as the vector distance from a parent
     point to this point.
 
+    Parameters
+    ==========
+
+    name : string
+        The display name of the Point
+
+    Examples
+    ========
+
+    >>> from sympy.physics.vector import Point, ReferenceFrame
+    >>> N = ReferenceFrame('N')
+    >>> O = Point('O')
+    >>> P = Point('P')
+    >>> O.set_vel(N, 10 * N.x + 20 * N.y + 30 * N.z)
+    >>> O.set_acc(N, 7 * N.x + 14 * N.y)
+    >>> O.vel(N)
+    10*N.x + 20*N.y + 30*N.z
+    >>> O.acc(N)
+    7*N.x + 14*N.y
path: sympy/physics/vector/point.py
text: @user1:
Please use symbols for the vector measure numbers instead of integers.

diff_hunk: @@ -13,6 +13,40 @@ class Point(object):
     The position is a vector defined as the vector distance from a parent
     point to this point.
 
+    Parameters
+    ==========
+
+    name : string
+        The display name of the Point
+
+    Examples
+    ========
+
+    >>> from sympy.physics.vector import Point, ReferenceFrame
+    >>> N = ReferenceFrame('N')
+    >>> O = Point('O')
+    >>> P = Point('P')
+    >>> O.set_vel(N, 10 * N.x + 20 * N.y + 30 * N.z)
+    >>> O.set_acc(N, 7 * N.x + 14 * N.y)
+    >>> O.vel(N)
+    10*N.x + 20*N.y + 30*N.z
+    >>> O.acc(N)
+    7*N.x + 14*N.y
+
+    Example to create multiple Points:
path: sympy/physics/vector/point.py
text: @user1:
Make text similar to recommendation I had for reference frames.