From 54a2da2fa035b7fc7660b9c26f1521c09a5f8148 Mon Sep 17 00:00:00 2001 From: Matt Hall <5151457+mattEhall@users.noreply.github.com> Date: Wed, 12 Jun 2024 17:11:50 -0600 Subject: [PATCH] Subsystem.plot2d fix (positions were offset incorrectly) --- moorpy/subsystem.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moorpy/subsystem.py b/moorpy/subsystem.py index 697ed55..c940021 100644 --- a/moorpy/subsystem.py +++ b/moorpy/subsystem.py @@ -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