Something like this:
        left = self.meshgrid.clone()
        right = self.meshgrid.clone()
        
        left[:,:,0] -= self.k
        left[:,:,1] -= self.k
        right[:,:,0] -= self.h
        right[:,:,1] -= self.h
        
        left[:,:,1] *= -torch.sin(self.theta)
        left[:,:,0] *= torch.cos(self.theta)
        right[:,:,0] *= torch.sin(self.theta)
        right[:,:,1] *= torch.cos(self.theta)