{"id":16519110,"url":"https://github.com/pdebuyl/fortran_quaternion","last_synced_at":"2026-03-04T09:31:54.331Z","repository":{"id":151028047,"uuid":"81025005","full_name":"pdebuyl/fortran_quaternion","owner":"pdebuyl","description":"Basic quaternion operations","archived":false,"fork":false,"pushed_at":"2017-03-02T14:44:00.000Z","size":14,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T22:22:17.650Z","etag":null,"topics":["fortran"],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdebuyl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-02-05T21:54:44.000Z","updated_at":"2023-09-06T12:29:01.000Z","dependencies_parsed_at":"2023-09-25T00:58:59.311Z","dependency_job_id":null,"html_url":"https://github.com/pdebuyl/fortran_quaternion","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"7a7e26530e040bcddd36eadad73044a0ae07893c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pdebuyl/fortran_quaternion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdebuyl%2Ffortran_quaternion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdebuyl%2Ffortran_quaternion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdebuyl%2Ffortran_quaternion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdebuyl%2Ffortran_quaternion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdebuyl","download_url":"https://codeload.github.com/pdebuyl/fortran_quaternion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdebuyl%2Ffortran_quaternion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30077074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran"],"created_at":"2024-10-11T16:45:14.554Z","updated_at":"2026-03-04T09:31:54.309Z","avatar_url":"https://github.com/pdebuyl.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fortran_quaternion\n\n**Author:** Pierre de Buyl  \n**License:** 3-clause BSD\n\n[![Build Status](https://travis-ci.org/pdebuyl/fortran_quaternion.svg?branch=master)](https://travis-ci.org/pdebuyl/fortran_quaternion)\n\n`fortran_quaternion` is a Fortran module that provides some basic quaternion functions.\n\n`fortran_quaternion` does not define any derived type, instead quaternions are provided as\n4-element vectors storing the vector part first and the scalar part last.\n\n- `qnew`: return a quaternion from the scalar and vector input.\n- `qvector`: return the vector part of a quaternion.\n- `qscalar`: return the scalar part of a quaternion.\n- `qnorm`: return the norm.\n- `qnormalize`: return the normalized quaternion.\n- `qconj`: return the conjugate.\n- `qinv`: return the inverse.\n- `qmul`: return the product of two quaternions.\n\n\n## Example programs\n\n### Multiplication of two quaternions\n\n~~~.f90\nprogram quaternion_usage\n  use quaternion\n  implicit none\n\n  double precision :: q1(4), q2(4)\n\n  q1 = qnew(v=[1.d0, 2.d0, 3.d0], s=4.d0)\n  q2 = qnew(v=[6.d0, 7.d0, 8.d0], s=5.d0)\n\n  write(*,'(4f5.2,a,4f5.2)') q1, ' x ', q2\n  write(*,'(a,4f7.2)') '= ', qmul(q1, q2)\n\nend program quaternion_usage\n~~~\n\n### Rotation of a 3d vector about a given axis\n\n~~~.f90\nprogram quaternion_rotation\n  use quaternion\n  implicit none\n\n  double precision :: q(4), v(3)\n  double precision :: axis(3), theta\n\n  axis = [ 1, 1, 0 ]\n  theta = 2*atan(1.d0) ! pi/2\n\n  q = qnew(s=cos(theta/2), v=sin(theta/2)*axis/norm2(axis))\n\n  v = [0, 0, 1]\n\n  write(*,'(a,3f7.2)') 'v = ', v\n  ! Rotate qv by q\n  v = qvector(qmul(q, qmul(qnew(v=v), qconj(q))))\n  write(*,'(a,3f7.2)') 'rotated v = ', v\n\nend program quaternion_rotation\n~~~\n\n## Installation\n\nCopy the file `src/quaternion.f90` *or* use cmake (with the `add_subdirectory` command) to\nadd the library to your project.\n\n## Tests\n\nTests are defined in `test/` and rely on\n[fortran_tester](https://github.com/pdebuyl/fortran_tester), installed via git submodules:\n\n    git submodule init\n    git submodule update\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdebuyl%2Ffortran_quaternion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdebuyl%2Ffortran_quaternion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdebuyl%2Ffortran_quaternion/lists"}