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

  • SEARCH
  • Home
  • 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 9160767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:48:53+00:00 2026-06-17T13:48:53+00:00

A weired issue I am struggling with to find angle between two vectors using

  • 0

A weired issue I am struggling with to find angle between two vectors using built-in function

var v1:Vector3D = new Vector3D(0, 0, 0);
var v2:Vector3D = new Vector3D(50, 0, 50);
//Vector3D(0, 0, 0) Vector3D(50, 0, 50)
var angle1:Number = Vector3D.angleBetween(v1,v2) * 180 / Math.PI;
var angle2:Number = Vector3D.angleBetween(v2,v1) * 180 / Math.PI;

trace(angle1,angle2);

This returns NaN for both angle1 and angle2

However, if I pass a non-zero value (any smaller number such as 0.00001) as y property to any of the vector then I get the number/angle

For this reason, I am cloning my vectors and adding a small number (0.00001) to y before calling this method.

I am not sure if I am doing something wrong or its a bug there. Can some one help?

  • 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-06-17T13:48:54+00:00Added an answer on June 17, 2026 at 1:48 pm

    Vector(0,0,0) has infinity angles, and 0 size (from def.). that’s why there is no angle between.
    you can add

    if(angle1 == NaN) {
      //fix
    }
    

    to make it work the way you want.

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

Sidebar

Related Questions

I'm running into a weird issue that I'm struggling to figure out what's causing
I had a weird issue arise after using CodeMaid to clean up my code.
I have a weird issue with creating an Bitmap in C++. I'm using the
I have a really weird issue here. I'm using my local development server right
Having a weird issue. I'm new to Macs and have a windows VM that
This is a weird issue. I'm accessing my online database using premiumsofts Navicat for
I have a weird issue using polymorphism. I have a base class that implements
I have this weird issue in Magento when someone places an order using PayPal
I disovered a wired issue using Paypal ExpressCheckout with discounts: I pass 2 Items
I have a weird issue... I'm unable to find the simulator as a device

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.