From e581747761e54f031cb9d2e7dbc6d0a5a6cd919c Mon Sep 17 00:00:00 2001 From: azurepolarbear Date: Fri, 27 Dec 2024 23:09:24 -0600 Subject: [PATCH] Update Point class. --- src/main/wave/point/point.ts | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/main/wave/point/point.ts b/src/main/wave/point/point.ts index 1a68083..ad37839 100644 --- a/src/main/wave/point/point.ts +++ b/src/main/wave/point/point.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 brittni and the polar bear LLC. + * Copyright (C) 2015-2024 brittni and the polar bear LLC. * * This file is a part of azurepolarbear's rainbow waves algorithmic art project, * which is released under the GNU Affero General Public License, Version 3.0. @@ -23,29 +23,27 @@ import P5Lib from 'p5'; -import {CanvasContext, CanvasRedrawListener, CoordinateMode, P5Context} from '@batpb/genart'; +import { CanvasContext, P5Context } from '@batpb/genart'; export interface PointConfig { - base: P5Lib.Vector; - diameter: number; - coordinateMode: CoordinateMode; waveRatio_start: number; waveRatio_end: number; + base: P5Lib.Vector; + diameter: number; } /** * NOTES: * - The Point class assumes that it's base is on a line starting at (0, 0), and ending at (waveLength, 0). */ -export class Point implements CanvasRedrawListener { +export class Point { + #waveRatio_start: number; + #waveRatio_end: number; #base: P5Lib.Vector; #diameter: number; // #theta: number = 0; // #deltaTheta: number = 0.01; - #waveRatio_start: number; - #waveRatio_end: number; - public constructor(config: PointConfig) { this.#base = config.base; this.#diameter = config.diameter; @@ -62,11 +60,11 @@ export class Point implements CanvasRedrawListener { } public get waveRatio_center(): number { - return (this.#waveRatio_start + this.#waveRatio_end) / 2; + return (this.waveRatio_start + this.waveRatio_end) / 2; } public get waveRatio_length(): number { - return Math.abs(this.#waveRatio_end - this.#waveRatio_start); + return Math.abs(this.waveRatio_end - this.waveRatio_start); } public draw(): void { @@ -77,9 +75,6 @@ export class Point implements CanvasRedrawListener { p5.ellipse(this.#base.x, this.#base.y, this.#diameter, this.#diameter); } - public canvasRedraw(): void { - } - public updateBase(base: P5Lib.Vector): void { this.#base.set(base); }