Skip to content

Commit

Permalink
Subsystem.plot2d fix (positions were offset incorrectly)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattEhall committed Jun 12, 2024
1 parent 1d71069 commit 54a2da2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions moorpy/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ def drawLine2d(self, Time, ax, color="k", endpoints=False, Xuvec=[1,0,0], Yuvec=
# get the Line's local coordinates
Xs0, Ys0, Zs, tensions = line.getLineCoords(Time)

# transform to global coordinates
Xs = self.rA[0] + Xs0*self.cos_th - Ys0*self.sin_th
Ys = self.rA[1] + Xs0*self.sin_th + Ys0*self.cos_th
# transform to global coordinates (Ys0 should be zero for now)
Xs = self.rA[0] + (Xs0 + self.span)*self.cos_th - Ys0*self.sin_th
Ys = self.rA[1] + (Xs0 + self.span)*self.sin_th + Ys0*self.cos_th

# apply 3D to 2D transformation to provide desired viewing angle
Xs2d = Xs*Xuvec[0] + Ys*Xuvec[1] + Zs*Xuvec[2] + Xoff
Expand Down

0 comments on commit 54a2da2

Please sign in to comment.