![]() |
AW: Punkt in Abhängigkeit eines Winkels berechnen
Noch mal ganz langsam zum mitschreiben: ;)
Code:
Den Vektor drehen:
V1: TPoint = (x = 5, y = 0); // Vektor
P1: TPoint = (x = 3, y = 4); // Ausgangspunkt A: Double = 90; // Winkel eventuell noch umrechnen
Code:
Den Punkt verschieben:
V2.x = V1.x * cos(a) - V1.y * sin(a)
V2.x = 5 * 0 - 0 * 1 V2.x = 0 -------- V2.y = V1.y * cos(a) + v1.x * sin(a); V2.y = 0 * 0 + 5 * 1 V2.y = 5 --------
Code:
P2.x = P1.x + V2.x
P2.x = 3 + 0 P2.x = 3 ======== P2.y = P1.y + V2.y P2.y = 4 + 5 P2.y = 9 ======== |
AW: Punkt in Abhängigkeit eines Winkels berechnen
Seit dem Post von Medium hab' ich's schon verstanden :wink:
Danke an alle! :cheers: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:46 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz