Add missing documentation
CI / cargo fmt (push) Failing after 25s
CI / cargo test (GPU) (push) Has been cancelled
CI / cargo test (push) Has been cancelled

This commit is contained in:
2026-06-27 11:02:19 -04:00
parent a9da463041
commit 344ecc3450
4 changed files with 46 additions and 8 deletions
+9 -1
View File
@@ -1,17 +1,25 @@
//! # Transform
//!
//! Transforms are the "functions" in an iterated function system. They take in a point,
//! and generate a new point. For fractal flames, transforms are always affine,
//! but produce more interesting images once we add variations.
use bytemuck::{Pod, Zeroable};
use glam::{Affine2, Vec2};
/// Affine transform for use in the [`chaos_game`](crate::chaos_game).
#[derive(Copy, Clone, Pod, Zeroable)]
#[repr(C)]
pub struct Transform {
pub coefficients: Affine2,
coefficients: Affine2,
}
impl Transform {
/// Create a new transform from an affine transformation matrix
pub fn new(coefficients: Affine2) -> Self {
Transform { coefficients }
}
/// Apply this transform to a point in IFS coordinates, producing a new point
pub fn transform_point(&self, point: Vec2) -> Vec2 {
self.coefficients.transform_point2(point)
}