Skip to content

Add full rotation to units#187

Merged
rprospero merged 6 commits intomasterfrom
rotation-unit
Feb 17, 2026
Merged

Add full rotation to units#187
rprospero merged 6 commits intomasterfrom
rotation-unit

Conversation

@rprospero
Copy link
Contributor

@rprospero rprospero commented Feb 17, 2026

As part of looking into #173, it was noticed that we did not have an angular unit that represented a full rotation. To that end, I've added a rotation unit that is equal to 360° or 2π radians.

One major advantage, captured in a couple of new unit tests, is we can now explicitly set out interpretation of inverse time units.

units.hertz # inverse time with no angular component
units.rotations * units.hertz # rotational frequency  cos(2π f t)
units.radians * units.hertz # angular frequency cos(ω t)

As part of this process, the Unit class was extended to support more variations of scalar multiplication and division. For example, while we previously supported 60/units.minutes, an exception was thrown on 60*units.seconds or units.minutes/60

codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No quality gates enabled for this code.

See analysis details in CodeScene

Quality Gate Profile: Custom Configuration
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

@rprospero rprospero marked this pull request as ready for review February 17, 2026 14:49
Copy link
Contributor

@DrPaulSharp DrPaulSharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good.

@rprospero rprospero merged commit a0762b8 into master Feb 17, 2026
11 checks passed
@rprospero rprospero deleted the rotation-unit branch February 17, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments