program test use quaternion, only: & quat, assignment(=), conjg, exp, log, abs, sqrt use vector, only: & vec use typedef, only: & real64 implicit None type(quat) :: & q, p real(kind=real64), dimension(0:3) :: & f type(vec) :: & v real(kind=real64) :: x, y complex(kind=real64) :: z integer :: i ! q = quat((/1.d0,2.d0,3.d0,4.d0/)) ! print*,q ! q = quat((/1.d0,2.d0,3.d0/)) ! print*,q ! q = quat(1.d0, 2.d0, 3.d0) ! print*,q ! q = quat(1.d0) ! print*,q ! q = quat() ! print*,q ! f = (/1.d0,2.d0,3.d0,5.d0/) ! q = f ! print*,p ! q = 1.d0 ! print*,q ! q = (/2.d0, 0.d0, 0.d0, 0.d0/) ! print*,q ! q = (/7.d0, 0.d0, 0.d0/) ! print*,q q = quat(1.d0, 2.d0, 3.d0, 4.d0) p = quat(5.d0, 6.d0, 7.d0, 8.d0) ! print*,+p ! print*,p+q ! print*,-p ! print*,q-p ! print*, q * 2.d0 ! print*, 2.d0 * q ! print*, p * q ! print*, q * p ! print*, q / 2.d0 ! print*, 2.d0 / q ! print*, p / q ! print*, (p / q) * q ! print*, 1.d0 + q ! print*, q + 1.d0 ! print*, q == p ! print*, q%aimag() ! v = p%aimag() ! print*,exp(q) ! print*,exp(q*1.d-14) ! print*,p**q ! print*,2.d0**p ! q = p**2 ! print*,q ! print*,abs(q) ! print*, q%f(1:3) / norm2(q%f(1:3)) ! q = p**2.d0 ! print*,q ! print*,abs(q) ! print*, q%f(1:3) / norm2(q%f(1:3)) ! y = 0.d0 ! do i=1,100000000 ! x = dble(i) ! ! y = y + cos(x) ! ! y = y + sin(x) ! z = exp(DCMPLX(0.d0, x)) ! y = y + real(z) ! y = y + aimag(z) ! enddo ! print*,y q = 1.d0 x = atan(1.d0) * 1.d-8 do i=1,100000000 y = i * x q = q + sqrt(p) enddo print*,q end program test