Skip to content

Feature request: Represent Hz as 1/s #247

Open
@monban

Description

@monban

Example use-case: I would like to know the approximate length of antenna for a 145MHz (amateur radio) signal. The formula for wavelength is

$${\lambda} = \frac{v}{f}$$

Where f is the frequency in Hertz, which is a unit of cycles / second. Since we're dealing with electromagnetic radiation, velocity v=c (not accounting for velocity factor, which we will set aside for the purposes of this discussion). Written out, this means the full formula should look like:

$${\lambda} = \frac{299,792,458m/s}{145*10^6/s}$$

fend is smart enough to know that the seconds can cancel out, leaving us with

$${\lambda} = \frac{299,792,458m}{145*10^6} \approx 2.0675341931m$$

Expected behaviour:

> c/145MHz
approx. 2.0675341931 m

Actual behaviour:

> c/145MHz
approx. 2067534.1931034482 m MHz / s

For now, I've been using this workaround:

> c/(145e6/s)
approx. 2.0675341931 m

I would much prefer if fend simply understood that nHz represents n/s (and of course si prefixes like kHz and MHz represent $n(10^3)$ and $n(10^6)$ respectively) so that equations like solving for wavelength would simply come out correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions