/** * Coordinate geometry utilities for Fretboard Renderer Library */ import type { Position } from '../fretboard/types'; /** * Calculate total width of fretboard in horizontal orientation * * Computes the total width needed to display all frets horizontally. * Width is determined by fret count multiplied by fret spacing. * * @param fretCount - Number of frets on the fretboard * @param fretSpacing - Pixel spacing between fret lines * @returns number - Total width in pixels * * @example * ```typescript * const width = calculateHorizontalWidth(12, 60); // 720px for 12 frets at 60px spacing * ``` */ export declare function calculateHorizontalWidth(fretCount: number, fretSpacing: number): number; /** * Calculate total height of fretboard in horizontal orientation * * Computes the total height needed to display all strings vertically in horizontal orientation. * Height is determined by string count, spacing, and thickness. * * @param stringCount - Number of strings on the fretboard * @param stringSpacing - Pixel spacing between string lines * @param stringThickness - Visual thickness of strings in pixels * @returns number - Total height in pixels * * @example * ```typescript * const height = calculateHorizontalHeight(6, 30, 1); // 151px for 6 strings at 30px spacing * ``` */ export declare function calculateHorizontalHeight(stringCount: number, stringSpacing: number, stringThickness: number): number; /** * Calculate total width of fretboard in vertical orientation * * Computes the total width needed to display all strings horizontally in vertical orientation. * Width is determined by string count, spacing, and thickness. * * @param stringCount - Number of strings on the fretboard * @param stringSpacing - Pixel spacing between string lines * @param stringThickness - Visual thickness of strings in pixels * @returns number - Total width in pixels * * @example * ```typescript * const width = calculateVerticalWidth(6, 30, 1); // 151px for 6 strings at 30px spacing * ``` */ export declare function calculateVerticalWidth(stringCount: number, stringSpacing: number, stringThickness: number): number; /** * Calculate total height of fretboard in vertical orientation * * Computes the total height needed to display all frets vertically in vertical orientation. * Height is determined by fret count multiplied by fret spacing. * * @param fretCount - Number of frets on the fretboard * @param fretSpacing - Pixel spacing between fret lines * @returns number - Total height in pixels * * @example * ```typescript * const height = calculateVerticalHeight(24, 40); // 960px for 24 frets at 40px spacing * ``` */ export declare function calculateVerticalHeight(fretCount: number, fretSpacing: number): number; /** * Get string Y position for horizontal orientation * * In horizontal orientation, strings are displayed top-to-bottom with the highest-pitched * string (high E) at the top and lowest-pitched string (low E) at the bottom. * * @param stringIndex - Zero-based index of the string (0 = high E, N-1 = low E) * @param stringSpacing - Pixel spacing between strings * @returns number - The Y coordinate for the string in horizontal orientation * * @example * ```typescript * // For a 6-string guitar in horizontal orientation * const highE_Y = getHorizontalStringY(0, 20); // 0 (topmost) * const lowE_Y = getHorizontalStringY(5, 20); // 100 (bottommost) * ``` */ export declare function getHorizontalStringY(stringIndex: number, stringSpacing: number): number; /** * Get string X position for vertical orientation * * In vertical orientation, strings are displayed left-to-right with the lowest-pitched * string (low E) on the left and highest-pitched string (high E) on the right, matching * the standard guitar neck layout when viewed vertically. * * @param stringIndex - Zero-based index of the string (0 = high E, N-1 = low E) * @param stringSpacing - Pixel spacing between strings * @param stringCount - Total number of strings * @returns number - The X coordinate for the string in vertical orientation * * @example * ```typescript * // For a 6-string guitar in vertical orientation * const lowE_X = getVerticalStringX(5, 20, 6); // 0 (leftmost) * const highE_X = getVerticalStringX(0, 20, 6); // 100 (rightmost) * ``` */ export declare function getVerticalStringX(stringIndex: number, stringSpacing: number, stringCount: number): number; /** * Get fret X position for horizontal orientation * Fret 1 is at x=0, Fret 2 at x=fretSpacing, etc. */ export declare function getHorizontalFretX(fretIndex: number, fretSpacing: number): number; /** * Get fret Y position for vertical orientation * Fret 1 is at y=0, Fret 2 at y=fretSpacing, etc. */ export declare function getVerticalFretY(fretIndex: number, fretSpacing: number): number; /** * Get inlay X position for horizontal orientation (above fretboard) */ export declare function getHorizontalInlayX(fretIndex: number, fretSpacing: number): number; /** * Get inlay Y position for horizontal orientation (above fretboard) */ export declare function getHorizontalInlayY(stringCount: number, stringSpacing: number, inlayOffset?: number): number; /** * Get inlay X position for vertical orientation (left of fretboard) */ export declare function getVerticalInlayX(stringCount: number, stringSpacing: number, inlayOffset?: number): number; /** * Get inlay Y position for vertical orientation (left of fretboard) */ export declare function getVerticalInlayY(fretIndex: number, fretSpacing: number): number; /** * Get marker position for horizontal orientation */ export declare function getHorizontalMarkerPosition(fretIndex: number, stringIndex: number, fretSpacing: number, stringSpacing: number): Position; /** * Get marker position for vertical orientation */ export declare function getVerticalMarkerPosition(fretIndex: number, stringIndex: number, fretSpacing: number, stringSpacing: number, stringCount: number): Position; /** * Get fret position for horizontal orientation */ export declare function getHorizontalFretPosition(fretIndex: number, fretSpacing: number, _height: number): Position; /** * Get fret position for vertical orientation */ export declare function getVerticalFretPosition(fretIndex: number, fretSpacing: number, _width: number): Position; /** * Get string position for horizontal orientation */ export declare function getHorizontalStringPosition(stringIndex: number, stringSpacing: number, _width: number): Position; /** * Get string position for vertical orientation */ export declare function getVerticalStringPosition(stringIndex: number, stringSpacing: number, height: number, stringCount: number): Position; /** * Calculate dynamic radius for fingering markers ensuring no overlap between adjacent strings * * @param stringSpacing - Pixel spacing between strings * @param fretSpacing - Pixel spacing between frets (optional) * @returns number - Marker radius in pixels */ export declare function calculateFingeringRadius(stringSpacing: number, fretSpacing?: number): number; /** * Calculate 2D position for a fingering marker on the fretboard * * Centers the marker on the string's visual center, accounting for * per-string thickness variation (thickness = stringThickness × stringNum), * and on the fret's visual center, accounting for fret thickness. * * @param stringNum - 1-based string number (1 = top string / high E) * @param fretNum - Fret number (0 = open string, 1..N = fretted position) * @param orientation - Layout direction ('horizontal' | 'vertical') * @param stringSpacing - Pixel spacing between strings * @param fretSpacing - Pixel spacing between frets * @param stringCount - Total string count * @param stringThickness - Base string thickness (each string's actual thickness = stringThickness × stringNum) * @param fretThickness - Thickness of fret lines * @returns Position - {x, y} coordinates of fingering marker center */ export declare function getFingeringPosition(stringNum: number, fretNum: number, orientation: 'horizontal' | 'vertical', stringSpacing: number, fretSpacing: number, stringCount: number, stringThickness?: number, fretThickness?: number, startFret?: number): Position; //# sourceMappingURL=geometry.d.ts.map