File indexing completed on 2024-05-12 15:23:44
0001 /* 0002 SPDX-FileCopyrightText: 2012 Andrew Stepanenko 0003 0004 Modified by Jasem Mutlaq <mutlaqja@ikarustech.com> for KStars: 0005 SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikarustech.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #pragma once 0011 0012 #include "vect.h" 0013 0014 namespace GuiderUtils 0015 { 0016 class Matrix 0017 { 0018 public: 0019 double x[4][4]; 0020 Matrix(); 0021 explicit Matrix(double); 0022 Matrix &operator+=(const Matrix &); 0023 Matrix &operator-=(const Matrix &); 0024 Matrix &operator*=(const Matrix &); 0025 Matrix &operator*=(double); 0026 Matrix &operator/=(double); 0027 void Invert(); 0028 void Transpose(); 0029 friend Matrix operator+(const Matrix &, const Matrix &); 0030 friend Matrix operator-(const Matrix &, const Matrix &); 0031 friend Matrix operator*(const Matrix &, double); 0032 friend Matrix operator*(const Matrix &, const Matrix &); 0033 friend GuiderUtils::Vector operator*(const GuiderUtils::Vector &, const Matrix &); 0034 }; 0035 0036 Matrix Translate(const GuiderUtils::Vector &); 0037 Matrix Scale(const GuiderUtils::Vector &); 0038 Matrix RotateX(double); 0039 Matrix RotateY(double); 0040 Matrix RotateZ(double); 0041 Matrix Rotate(const GuiderUtils::Vector &v, double angle); 0042 Matrix Transform(const GuiderUtils::Vector &v1, const GuiderUtils::Vector &v2, const GuiderUtils::Vector &v3); 0043 Matrix MirrorX(); 0044 Matrix MirrorY(); 0045 Matrix MirrorZ(); 0046 } // namespace GuiderUtils 0047