Skip to content

Commit 8b4bab3

Browse files
DmitryVasilevskyDmitry Vasilevsky
andauthored
Updated comment to trig functions to mention radians (#2825)
As discussed elsewhere, there's only one way to specify argument for trig functions and we already use it. We provide PI() so it should be convenient. Having said that, degrees are taught in school, so the only reason we may consider doing something about it is to facilitate education somehow. I probably mentioned this before, but "radians" are just numbers. They are ratios of two lengths. So, no matter the unit for the length, the ration is just a number. As for the issue, I don't see much harm in mentioning that we are using radians. They are part of the International System of Units after all. Although as a "derived unit". Degrees don't have the honor. They are just "acceptable". (https://www.bipm.org/documents/20126/41483022/SI-Brochure-9.pdf, page 145) Resolves #2773 Co-authored-by: Dmitry Vasilevsky <[email protected]>
1 parent ac9b6d0 commit 8b4bab3

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

library/std/src/Std/Math.qs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,79 +250,85 @@ function Min(values : Int[]) : Int {
250250

251251
/// # Summary
252252
/// Returns the angle whose cosine is the specified number.
253+
/// Returned value is expressed in radians.
253254
function ArcCos(x : Double) : Double {
254255
body intrinsic;
255256
}
256257

257258
/// # Summary
258259
/// Returns the angle whose sine is the specified number.
260+
/// Returned value is expressed in radians.
259261
function ArcSin(y : Double) : Double {
260262
body intrinsic;
261263
}
262264

263265
/// # Summary
264266
/// Returns the angle whose tangent is the specified number.
267+
/// Returned value is expressed in radians.
265268
function ArcTan(d : Double) : Double {
266269
body intrinsic;
267270
}
268271

269272
/// # Summary
270273
/// Returns the angle whose tangent is the quotient of two specified numbers.
274+
/// Returned value is expressed in radians.
271275
function ArcTan2(y : Double, x : Double) : Double {
272276
body intrinsic;
273277
}
274278

275279
/// # Summary
276280
/// Returns the cosine of the specified angle.
281+
/// Angle is specified in radians.
277282
function Cos(theta : Double) : Double {
278283
body intrinsic;
279284
}
280285

281286
/// # Summary
282-
/// Returns the hyperbolic cosine of the specified angle.
287+
/// Returns the hyperbolic cosine of the specified number.
283288
function Cosh(d : Double) : Double {
284289
body intrinsic;
285290
}
286291

287292
/// # Summary
288293
/// Returns the sine of the specified angle.
294+
/// Angle is specified in radians.
289295
function Sin(theta : Double) : Double {
290296
body intrinsic;
291297
}
292298

293299
/// # Summary
294-
/// Returns the hyperbolic sine of the specified angle.
300+
/// Returns the hyperbolic sine of the specified number.
295301
function Sinh(d : Double) : Double {
296302
body intrinsic;
297303
}
298304

299305
/// # Summary
300306
/// Returns the tangent of the specified angle.
307+
/// Angle is specified in radians.
301308
function Tan(d : Double) : Double {
302309
body intrinsic;
303310
}
304311

305312
/// # Summary
306-
/// Returns the hyperbolic tangent of the specified angle.
313+
/// Returns the hyperbolic tangent of the specified number.
307314
function Tanh(d : Double) : Double {
308315
body intrinsic;
309316
}
310317

311318
/// # Summary
312-
/// Computes the inverse hyperbolic cosine of a number.
319+
/// Returns the inverse hyperbolic cosine of a number.
313320
function ArcCosh(x : Double) : Double {
314321
Log(x + Sqrt(x * x - 1.0))
315322
}
316323

317324
/// # Summary
318-
/// Computes the inverse hyperbolic sine of a number.
325+
/// Returns the inverse hyperbolic sine of a number.
319326
function ArcSinh(x : Double) : Double {
320327
Log(x + Sqrt(x * x + 1.0))
321328
}
322329

323-
324330
/// # Summary
325-
/// Computes the inverse hyperbolic tangent of a number.
331+
/// Returns the inverse hyperbolic tangent of a number.
326332
function ArcTanh(x : Double) : Double {
327333
Log((1.0 + x) / (1.0 - x)) * 0.5
328334
}

0 commit comments

Comments
 (0)