File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -277,12 +277,30 @@ pub mod trig_functions {
277277 }
278278
279279 /// Returns the cosecant of the argument given in radians
280+ /// ```typescript
281+ /// assert_eq(csc(-pi/2), -1.0)
282+ /// ```
283+ /// ```typescript
284+ /// assert_eq(csc(0.0), 1.0/0.0)
285+ /// ```
286+ /// ```typescript
287+ /// assert_eq(csc(pi/2), 1.0)
288+ /// ```
280289 #[ rhai_fn( name = "csc" ) ]
281290 pub fn csc ( radians : FLOAT ) -> FLOAT {
282291 1.0 / FLOAT :: sin ( radians)
283292 }
284293
285294 /// Returns the cosecant of the argument given in degrees
295+ /// ```typescript
296+ /// assert_eq(cscd(-90.0), -1.0)
297+ /// ```
298+ /// ```typescript
299+ /// assert_eq(cscd(0.0), 1.0/0.0)
300+ /// ```
301+ /// ```typescript
302+ /// assert_eq(cscd(90.0), 1.0)
303+ /// ```
286304 #[ rhai_fn( name = "cscd" ) ]
287305 pub fn cscd ( degrees : FLOAT ) -> FLOAT {
288306 1.0 / FLOAT :: sin ( deg2rad ( degrees) )
You can’t perform that action at this time.
0 commit comments