# -----------------------------------------------------------------------------# This file was autogenerated by symforce from template:# ops/CLASS/lie_group_ops.py.jinja# Do NOT modify by hand.# -----------------------------------------------------------------------------# ruff: noqa: PLR0915, F401, PLW0211, PLR0914from__future__importannotationsimportmathimporttypingasTimportnumpyimportsym
[docs]classLieGroupOps(object):""" Python LieGroupOps implementation for :py:class:`symforce.geo.unit3.Unit3`. """
[docs]@staticmethoddefretract(a:sym.Unit3,vec:numpy.ndarray,epsilon:float)->sym.Unit3:# Total ops: 84# Input arrays_a=a.dataifvec.shape==(2,):vec=vec.reshape((2,1))elifvec.shape!=(2,1):raiseIndexError("vec is expected to have shape (2, 1) or (2,); instead had shape {}".format(vec.shape))# Intermediate terms (25)_tmp0=_a[2]+epsilon*math.copysign(1,_a[2])_tmp1=math.sqrt(epsilon+vec[0,0]**2+vec[1,0]**2)_tmp2=_tmp1+epsilon*math.copysign(1,_tmp1)_tmp3=math.sin(_tmp2)/_tmp2_tmp4=_tmp3*vec[1,0]_tmp5=_a[0]-1_tmp6=_a[1]**2_tmp7=max(0,-(0.0if_a[2]**2+_tmp6-10*epsilon*math.copysign(1,_a[0])==0elsemath.copysign(1,_a[2]**2+_tmp6-10*epsilon*math.copysign(1,_a[0]))),)_tmp8=1-_tmp7_tmp9=_tmp5**2_tmp10=_tmp0**2_tmp11=_tmp10+_tmp6_tmp12=1/(_tmp11+_tmp9)_tmp13=2*_tmp12_tmp14=_tmp13*_tmp8_tmp15=_tmp14*_tmp5_tmp16=_tmp3*vec[0,0]_tmp17=math.cos(_tmp1)_tmp18=1/_tmp11_tmp19=_a[1]*_tmp0_tmp20=2*_tmp18*_tmp19*_tmp7_tmp21=_tmp14*_tmp19_tmp22=2*_tmp6_tmp23=_tmp15*_tmp17_tmp24=2*_tmp10# Output terms_res=[0.0]*3_res[0]=(_a[1]*_tmp15*_tmp16-_tmp0*_tmp15*_tmp4+_tmp17*(_tmp7+_tmp8*(-_tmp13*_tmp9+1)))_res[1]=(-_a[1]*_tmp23+_tmp16*(-_tmp7*(-_tmp18*_tmp22+1)-_tmp8*(-_tmp12*_tmp22+1))+_tmp4*(-_tmp20-_tmp21))_res[2]=(-_tmp0*_tmp23+_tmp16*(_tmp20+_tmp21)+_tmp4*(_tmp7*(-_tmp18*_tmp24+1)+_tmp8*(-_tmp12*_tmp24+1)))returnsym.Unit3.from_storage(_res)