Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6948777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:52:03+00:00 2026-05-27T13:52:03+00:00

Suppose I have an object which is defined as an array of vector points,

  • 0

Suppose I have an object which is defined as an array of vector points, and by default it’s looking down the +x axis. If I want to make the object face a unit vector, say, (0,1), how would I do so? I’d assume its similar for 3D space?

EDIT: I don’t think trigonometric functions are necessary for this, so please don’t use angles and/or arctangents.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:52:03+00:00Added an answer on May 27, 2026 at 1:52 pm

    It’s considerably easier for 2D. In 2D, object rotation can just be expressed as a single angle. Use your orientation vector to call an arctangent routine to get the angle, and then rotate your object by that angle.

    EDIT: No arctangents? OK, well, you want the X-axis of points in the object to become some vector (u, v). In that case, the y-axis is always expressible as (-v, u), which will also be a unit vector if (u, v) was a unit vector.

    So just do this: if you have a point (x, y) relative to your object, the position relative to the world should be (object.xCenter, object.yCenter) + x(u, v) + y(-v, u) = (object.xCenter + u*x - v*y, object.yCenter + v*x + u*y).

    Example: object located at (5,5). It has a point relative to it at (2, 2) when facing in the x axis direction. If you now wish to orient it at (sqrt(2)/2, sqrt(2)/2) (unit length version of (1, 1)), the point, relative to the world, is (5, 5 + 2*sqrt(2)).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a method which changes the state of an object, and fires
Suppose I have an entity object defined as public partial class Article { public
Suppose we have a function MutateX which will mutate a mutable object x (in
Suppose I have some object of type T , and I want to put
I have a Serializable object which is supposed to hold a java.awt.Image as its
In C#, suppose you have an object (say, myObject ) that is an instance
How do you use variables to access Object attributes? Suppose I have an Object
Suppose I have a python object x and a string s , how do
Suppose I have a customer object that has all of the standard customer properties
Propose to consider the following problem. Suppose we have some composite object. Are there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.