We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58a9fb6 commit 3e8a86cCopy full SHA for 3e8a86c
spatialmath/base/symbolic.py
@@ -134,6 +134,28 @@ def cos(theta):
134
else:
135
return math.cos(theta)
136
137
+def tan(theta):
138
+ """
139
+ Generalized tangent function
140
+
141
+ :param θ: argument
142
+ :type θ: float or symbolic
143
+ :return: tan(θ)
144
+ :rtype: float or symbolic
145
146
+ .. runblock:: pycon
147
148
+ >>> from spatialmath.base.symbolic import *
149
+ >>> theta = symbol('theta')
150
+ >>> tan(theta)
151
+ >>> tan(0.5)
152
153
+ :seealso: :func:`sympy.cos`
154
155
+ if issymbol(theta):
156
+ return sympy.tan(theta)
157
+ else:
158
+ return math.tan(theta)
159
160
def sqrt(v):
161
"""
0 commit comments