Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistency in definition of slope: deg or rad? #261

Open
chgessner opened this issue Dec 15, 2022 · 1 comment
Open

inconsistency in definition of slope: deg or rad? #261

chgessner opened this issue Dec 15, 2022 · 1 comment

Comments

@chgessner
Copy link

In the specification https://ucum.org/ucum and in ucum-essence the definition of slope ( unit Code="%[slope]" ) is Unit="100tan(1 rad)". But in the function element the Unit is "deg". Which is correct?

@gschadow
Copy link

gschadow commented May 2, 2023

To show what Christof means

<u:unit id="600271" Code="[p'diop]" CODE="[P'DIOP]" isMetric="no"><name>prism diopter</name><printSymbol>PD</printSymbol><property>refraction of a prism</property><value Unit="100tan(1 rad)" UNIT="100TAN(1 RAD)"><function name="tanTimes100" value="1" Unit="rad"/></value></u:unit>
<u:unit id="600272" Code="%[slope]" CODE="%[SLOPE]" isMetric="no"><name>percent of slope</name><printSymbol>%</printSymbol><property>slope</property><value Unit="100tan(1 rad)" UNIT="100TAN(1 RAD)"><function name="100tan" value="1" Unit="deg"/></value></u:unit>

The slope % is the absolute value of change of height per horizontal distance, or opposite side to adjacent side. That is the definition of the tangent function (tan). Multiplication by 100 gives the percent scale. I can apply the tangent on rad or degrees (after I convert the degrees to radian). Therefore there should not be a difference whether we use radian or degrees in the argument. Now of course, before applying a tangent function on some computer programming language, one should have the argument scaled to rad. Therefore, it is probably better to say function/@Unit="rad" in the unit, not function/@Unit=deg.

Would this actually lead to different results? I should check my implementations. But even if it would, I think the change would be a correction, not a new version of the unit. It should be corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants