+ Reply to Thread
Results 1 to 7 of 7

Thread: Normalizing vector direction.

  1. #1
    Wire Noob Shockbolt's Avatar
    Join Date
    Sep 2007
    Posts
    12

    Default

    Currently i'm working on a stabilizer for every direction, similar to the hoverballs Air Resistance.

    So, right now i'm trying to let the computer calculate wich thruster gets wich power input.

    I got to normalizing direction vectors, and found out:
    Forward: X = 1, Y and Z are 0.
    90 degrees left: X and Z are 0, Y = 1.
    so logically, X and Y should be 0.5 at 45 degrees left or right.
    But when i normalize the direction vector it gives 0.707 at that angle.

    How exactly does this work?

  2. #2
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    length is sqrt(X^2 + Y^2 + Z^2), and normalization is dividing the vector by its length.

  3. #3
    Wire Noob Shockbolt's Avatar
    Join Date
    Sep 2007
    Posts
    12

    Default

    length is sqrt(X^2 + Y^2 + Z^2), and normalization is dividing the vector by its length.[/b]
    No that wasn't the question, i understand how normalizing itself works, but i want to know why the normalized X vector is 0,707 at a 45 degrees angle, and not 0.5

    0.5 would be logical if its 0 at 90 degrees, and 1 at 0 degrees.

  4. #4
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    [attachment=1299mgnoes.PNG]
    Attached Thumbnails Attached Thumbnails Normalizing vector direction.-omgnoes.png  
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  5. #5
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    or simply sqrt(1^2 + 1^2 + 0^2) = sqrt(2) = 1.414 ... 1.414 / 2 = 0.707

  6. #6
    Wirererer cadde's Avatar
    Join Date
    Oct 2007
    Location
    Sweden
    Posts
    266

    Default

    Awesome replies from the devs as usual
    Most people dont understand trig.

  7. #7
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    or simply sqrt(1^2 + 1^2 + 0^2) = sqrt(2) = 1.414 ... 1.414 / 2 = 0.707[/b]
    Some people will not understand things that that complex
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

+ Reply to Thread

Similar Threads

  1. [E2 Help] Entity -> Direction Vector
    By Alchemise in forum Expression 2 Discussion & Help
    Replies: 7
    Last Post: 02-15-2009, 02:22 PM
  2. Expression2: Direction Vector
    By RabidCrab in forum Expression 2 Discussion & Help
    Replies: 2
    Last Post: 01-23-2009, 07:50 PM
  3. Vector Thrusters and Vector Direction with a Pod
    By zentiger in forum Installation and Malfunctions Support
    Replies: 8
    Last Post: 09-26-2008, 12:01 AM
  4. Finding direction for vector thruster
    By sukasa in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 01-03-2008, 08:38 AM
  5. Beacon Sensor "direction vector" suggestion
    By kuro11 in forum Ideas & Suggestions
    Replies: 10
    Last Post: 08-20-2007, 08:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots