rotationsx.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:jwst_gtvt 作者: spacetelescope 项目源码 文件源码
def cvt_c1c2_using_body2inertial_Q_to_v2v3pa_tuple(Q,coord1,coord2):
   """Given Q and a position, returns v2,v3,V3PA tuple """
   Vp_eci = Vector(1.,0.,0.)
   Vp_eci.set_xyz_from_angs(coord1,coord2)
   Vp_body_pt = Q.inv_cnvrt(Vp_eci)
   v2 = atan2(Vp_body_pt.y,Vp_body_pt.x)
   v3 = asin(unit_limit(Vp_body_pt.z))
   V3_body = Vector(0.,0.,1.)
   V3_eci_pt = self.cnvrt(V3_body)
   NP_eci = Vector(0.,0.,1.)
   V_left = cross(NP_eci,Vp_eci)
   if V_left.length()>0.:
    V_left = V_left / V_left.length()
   NP_in_plane = cross(Vp_eci,V_left)
   x = dot(V3_eci_pt,NP_in_plane)
   y = dot(V3_eci_pt,V_left)
   pa  = atan2(y,x)
   if pa < 0. : pa += PI2
   return (v2,v3,pa)


############################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号