{"id":16965059,"url":"https://github.com/propensive/baroque","last_synced_at":"2025-07-11T14:37:01.356Z","repository":{"id":179534342,"uuid":"663648011","full_name":"propensive/baroque","owner":"propensive","description":"Make coding with complex numbers more real","archived":false,"fork":false,"pushed_at":"2025-02-12T19:11:23.000Z","size":1603,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-04T22:48:33.657Z","etag":null,"topics":["complex-numbers","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/propensive.png","metadata":{"files":{"readme":".github/readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-07T19:37:42.000Z","updated_at":"2025-02-12T19:11:27.000Z","dependencies_parsed_at":"2024-02-27T10:13:16.087Z","dependency_job_id":"725ed9d4-077f-427b-a0c7-02266b9b79d3","html_url":"https://github.com/propensive/baroque","commit_stats":null,"previous_names":["propensive/baroque"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/propensive/baroque","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fbaroque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fbaroque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fbaroque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fbaroque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/propensive","download_url":"https://codeload.github.com/propensive/baroque/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fbaroque/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264833290,"owners_count":23670617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["complex-numbers","scala"],"created_at":"2024-10-13T23:44:55.352Z","updated_at":"2025-07-11T14:37:01.333Z","avatar_url":"https://github.com/propensive.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg alt=\"GitHub Workflow\" src=\"https://img.shields.io/github/actions/workflow/status/propensive/baroque/main.yml?style=for-the-badge\" height=\"24\"\u003e](https://github.com/propensive/baroque/actions)\n[\u003cimg src=\"https://img.shields.io/discord/633198088311537684?color=8899f7\u0026label=DISCORD\u0026style=for-the-badge\" height=\"24\"\u003e](https://discord.com/invite/MBUrkTgMnA)\n\u003cimg src=\"/doc/images/github.png\" valign=\"middle\"\u003e\n\n# Baroque\n\n__Make coding with complex numbers more real__\n\n_Baroque_ provides a single generic type, `Complex`, comprising of real and\nimaginary values of the same numeric type. This could be a `Double`, `Int` or a\n`Quantity` with units (as provided by\n[Quantitative](https://github.com/propensive/quantitative/)), or any other type\nwhich defines [Symbolism](https://github.com/propensive/symbolism) typeclass\ninstances.\n\n## Features\n\n- provides a generic representation of complex numbers\n- extends any numerical type to the complex\n- provides many standard complex numerical operations on values\n- allows conversion between cartesian and polar forms\n\n\n## Availability\n\n\n\n\n\n\n\n## Getting Started\n\nAll terms and types are defined in the `baroque` package, which can be imported\nwith:\n```scala\nimport baroque.*\n```\n\n### Constructing complex numbers\n\nThere are several ways to construct complex numbers. The factory method of\nspecifying real and imaginary part is the most straightforward, for example,\n```scala\nval complex = Complex(3.2, -1.25)\n```\nrepresents the complex number 3.2 - 1.25i.\n\nThis is an instance of `Complex[Double]`, since the real and imaginary parts of\nthe number are both `Double`s. With Quantitative, we could similarly create a\ncomplex quantity, for example,\n```scala\nval complex2 = Complex(3.2*Metre, -1.25*Metre)\n```\nwhich would be a `Complex[Quantity[Metres[1]]]`.\n\nBut it is also possible construct a complex number by adding the real part to\nthe imaginary part, where the imaginary part is created by multiplying a real\nnumber by _i_, the imaginary unit value, which is called `I` in Baroque:\n```scala\nval complex3 = 0.8 + 1.8*I\n```\n\nI further possibility is to specify the complex number in polar form, using the\n`Complex.polar` constructor. This takes two parameter, _magnitude_ and\n_argument_. The magnitude should have the same type a the real and imaginary\nparts of the number, and the argument must be a `Double`, in radians. For\nexample,\n```scala\nval complex4 = Complex.polar(12*Kilo(Gram), 0.3845)\n```\n\n### Operations with Complex Numbers\n\nStandard arithmetic operations between `Complex` instances, using the `+`, `-`,\n`*` and `/` operators work intuitively. Additionally, the prefix `~` operator\ncan be used to find the complex conjugate of a number.\n\nThe methods `modulus` and `argument` on `Complex` values provide, predictably,\nthe modulus and argument. And `sqrt` will yield one of the two square roots of\na `Complex` number; the other will be its negation.\n\nThese operations are defined, in general, so long as the necessary operations\n(such as addition, multiplication and square root) are defined on the\nunderlying type of the real and imaginary parts.\n\n\n\n\n## Status\n\nBaroque is classified as __embryotic__. For reference, Soundness projects are\ncategorized into one of the following five stability levels:\n\n- _embryonic_: for experimental or demonstrative purposes only, without any guarantees of longevity\n- _fledgling_: of proven utility, seeking contributions, but liable to significant redesigns\n- _maturescent_: major design decisions broady settled, seeking probatory adoption and refinement\n- _dependable_: production-ready, subject to controlled ongoing maintenance and enhancement; tagged as version `1.0.0` or later\n- _adamantine_: proven, reliable and production-ready, with no further breaking changes ever anticipated\n\nProjects at any stability level, even _embryonic_ projects, can still be used,\nas long as caution is taken to avoid a mismatch between the project's stability\nlevel and the required stability and maintainability of your own project.\n\nBaroque is designed to be _small_. Its entire source code currently consists\nof 143 lines of code.\n\n## Building\n\nBaroque will ultimately be built by Fury, when it is published. In the\nmeantime, two possibilities are offered, however they are acknowledged to be\nfragile, inadequately tested, and unsuitable for anything more than\nexperimentation. They are provided only for the necessity of providing _some_\nanswer to the question, \"how can I try Baroque?\".\n\n1. *Copy the sources into your own project*\n   \n   Read the `fury` file in the repository root to understand Baroque's build\n   structure, dependencies and source location; the file format should be short\n   and quite intuitive. Copy the sources into a source directory in your own\n   project, then repeat (recursively) for each of the dependencies.\n\n   The sources are compiled against the latest nightly release of Scala 3.\n   There should be no problem to compile the project together with all of its\n   dependencies in a single compilation.\n\n2. *Build with [Wrath](https://github.com/propensive/wrath/)*\n\n   Wrath is a bootstrapping script for building Baroque and other projects in\n   the absence of a fully-featured build tool. It is designed to read the `fury`\n   file in the project directory, and produce a collection of JAR files which can\n   be added to a classpath, by compiling the project and all of its dependencies,\n   including the Scala compiler itself.\n   \n   Download the latest version of\n   [`wrath`](https://github.com/propensive/wrath/releases/latest), make it\n   executable, and add it to your path, for example by copying it to\n   `/usr/local/bin/`.\n\n   Clone this repository inside an empty directory, so that the build can\n   safely make clones of repositories it depends on as _peers_ of `baroque`.\n   Run `wrath -F` in the repository root. This will download and compile the\n   latest version of Scala, as well as all of Baroque's dependencies.\n\n   If the build was successful, the compiled JAR files can be found in the\n   `.wrath/dist` directory.\n\n## Contributing\n\nContributors to Baroque are welcome and encouraged. New contributors may like\nto look for issues marked\n[beginner](https://github.com/propensive/baroque/labels/beginner).\n\nWe suggest that all contributors read the [Contributing\nGuide](/contributing.md) to make the process of contributing to Baroque\neasier.\n\nPlease __do not__ contact project maintainers privately with questions unless\nthere is a good reason to keep them private. While it can be tempting to\nrepsond to such questions, private answers cannot be shared with a wider\naudience, and it can result in duplication of effort.\n\n## Author\n\nBaroque was designed and developed by Jon Pretty, and commercial support and\ntraining on all aspects of Scala 3 is available from [Propensive\nO\u0026Uuml;](https://propensive.com/).\n\n\n\n## Name\n\nBaroque music, architecture and design is characterized by its ornate _complexity_ which alludes to _complex numbers_.\n\nIn general, Soundness project names are always chosen with some rationale,\nhowever it is usually frivolous. Each name is chosen for more for its\n_uniqueness_ and _intrigue_ than its concision or catchiness, and there is no\nbias towards names with positive or \"nice\" meanings—since many of the libraries\nperform some quite unpleasant tasks.\n\nNames should be English words, though many are obscure or archaic, and it\nshould be noted how willingly English adopts foreign words. Names are generally\nof Greek or Latin origin, and have often arrived in English via a romance\nlanguage.\n\n## Logo\n\nThe logo shows an [alto clef](https://en.wikipedia.org/wiki/Clef), used\npredominantly in music for viola (which features in Baroque music), and also\nresembles a capital B, the first letter of \"Baroque\".\n\n## License\n\nBaroque is copyright \u0026copy; 2025 Jon Pretty \u0026 Propensive O\u0026Uuml;, and\nis made available under the [Apache 2.0 License](/license.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Fbaroque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpropensive%2Fbaroque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Fbaroque/lists"}