affine 0.1.0 copy "affine: ^0.1.0" to clipboard
affine: ^0.1.0 copied to clipboard

Affine transformations calculations to get a mix of a transformation matrix and translation.

example/affine_example.dart

import 'dart:math';

import 'package:affine/affine.dart';
import 'package:vector_math/vector_math.dart';

void main() {
  final rect = Rectangle(0.0, 0.0, 100.0, 100.0);

  final points = [
    Vector2Tuple(Vector2(rect.left, rect.top), Vector2(0, 0)),
    Vector2Tuple(Vector2(rect.right, rect.top), Vector2(150, 50)),
    Vector2Tuple(Vector2(rect.left, rect.bottom), Vector2(0, 100)),
    Vector2Tuple(Vector2(rect.right, rect.bottom), Vector2(100, 100)),
  ];

  final matrix = affineFromPoints2D(points)!;

  print(matrix);
}
1
likes
160
pub points
0%
popularity

Publisher

unverified uploader

Affine transformations calculations to get a mix of a transformation matrix and translation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

vector_math

More

Packages that depend on affine