1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
4 TestCase := Rectangle {
5 property<float> t1: tan(0);
6 property<float> t2: tan(45deg);
7 property<float> t3: tan(75deg);
8}
9/*
10```cpp
11auto handle = TestCase::create();
12const TestCase &instance = *handle;
13assert(std::abs(instance.get_t1()) < 0.0001);
14assert(std::abs(instance.get_t2() - 1.0) < 0.0001);
15assert(std::abs(instance.get_t3() - (2.0 + std::sqrt(3.0))) < 0.0001);
16```
17
18```rust
19let instance = TestCase::new().unwrap();
20assert!(instance.get_t1().abs() < 0.0001);
21assert!((instance.get_t2() - 1.0).abs() < 0.0001);
22assert!((instance.get_t3() - (2.0 + 3.0_f32.sqrt())).abs() < 0.0001);
23```
24
25```js
26var instance = new slint.TestCase({});
27assert(Math.abs(instance.t1) < 0.0001);
28assert(Math.abs(instance.t2 - 1) < 0.0001);
29assert(Math.abs(instance.t3 - (2 + Math.sqrt(3))) < 0.0001);
30```
31*/
32