1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- // This is a basic Flutter widget test.
- //
- // To perform an interaction with a widget in your test, use the WidgetTester
- // utility that Flutter provides. For example, you can send tap and scroll
- // gestures. You can also use WidgetTester to find child widgets in the widget
- // tree, read text, and verify that the values of widget properties are correct.
- import 'dart:math' as math;
- import 'package:fis_measure/interfaces/date_types/point.dart';
- import 'package:fis_measure/interfaces/date_types/skew_transform.dart';
- import 'package:fis_measure/values/unit_desc.dart';
- import 'package:flutter_test/flutter_test.dart';
- import 'package:vid/us/vid_us_unit.dart';
- import 'ellipse.dart';
- void main() {
- test('ellipse ad', () {
- var startPoint = DPoint(0, 400);
- var endPoint = DPoint(400, 0);
- // var startPoint = DPoint(0, 400);
- // var endPoint = DPoint(400, 400);
- EllipseTest.calculateYAxisPoints(
- startPoint, startPoint, startPoint, endPoint, endPoint, false);
- });
- test('Unit Description', () {
- print(UnitDescriptionMap.getDesc(VidUsUnit.HR));
- print(UnitDescriptionMap.getDescByInt(60));
- });
- testWidgets('Counter increments smoke test', (WidgetTester tester) async {
- // Build our app and trigger a frame.
- });
- test("linear_tissue", () {
- const steer = 3.0;
- const depthStart = 1.0;
- const depthEnd = 3.99999991059303;
- final back = DSkewTransform(steer, 0, 0, (depthEnd - depthStart) / 2);
- final inverse = back.inverse;
- final p1 = inverse.transform(DPoint(0.84, 0.24907692307692308));
- final p2 = inverse.transform(DPoint(0.84, 0.4989230769230769));
- final d = (p2 - p1).lengthSquared;
- print(p1);
- print(p2);
- print(d);
- });
- test("convex_tissue", () {
- const zeroRadius = 5.1225;
- final logicalPoint = DPoint(1, 1);
- double depth = math.sqrt(math.pow(logicalPoint.x, 2) +
- math.pow(logicalPoint.y + zeroRadius, 2)) -
- zeroRadius;
- double tilt =
- toDegrees(math.atan2(logicalPoint.x, logicalPoint.y + zeroRadius));
- final d = DPoint(tilt, depth);
- print(d);
- });
- }
- double toDegrees(double angle) {
- return angle / math.pi * 180;
- }
|