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 6387449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:09:13+00:00 2026-05-25T03:09:13+00:00

I want to compute the angle between two edges in a face in 3D

  • 0

I want to compute the angle between two edges in a face in 3D space.

I thought I could used the solution in this question: Signed angle between two 3D vectors with same origin within the same plane

However, when I try it out on rectangle with all 90 degree angles I get one angle that’s 90 degrees and three that’s 270.

I have very little knowledge of math related to geometry, which is why I struggle with this and clearly made the wrong assumption.

So how do you calculate the angle between two edges in a face?

What I tried:

def self.full_angle_between( vector1, vector2, normal )
  angle = vector1.angle_between( vector2 )
  direction = normal % ( vector1 * vector2 )
  angle = 360.degrees - angle if direction < 0.0
  angle
end

normal is the face normal
vector1 and vector2 both origins from the same vertex and each points towards the next vertex in either direction

vector1.angle_between( vector2 ) refer to a method in the SketchUp Rubu API: http://code.google.com/apis/sketchup/docs/ourdoc/vector3d.html#angle_between
It return an angle between 0-180 in radians.

360.degrees yields the degrees in radians. Also an SketchUp API method.

When I iterate over all the vertices in a rectangle I get three angles reported as 270 degrees. Why?

  • 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-25T03:09:13+00:00Added an answer on May 25, 2026 at 3:09 am

    I would say your problem lies in this line:

    direction = normal % ( vector1 * vector2 )
    

    It’s not wrong in itself, but you might be passing in the wrong values.

    If you’re not fully up to speed on vector maths, the thing you may be missing is that the direction of the vector given by the cross product vector1 * vector2 depends on the order of the operands. If you swap them around you get the same vector pointing in the opposite direction.

    So when you’re iterating over the rectangle vertices, if you get the “next” and “previous” vertices mixed up you will get the bogus 270 degree results you describe.

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

Sidebar

Related Questions

I am writing a code in C++ and want to compute distance between two
I want to compute result from this table. I want quantity 1 - quantity2
I have two vectors of floats, x and y, and I want to compute
I want to compute differences between collections. When using CollectionUtils.subtract() for custom comparison I
I want to compute the time 4 hours later during the DST transition, either
For use in a rigid body simulation, I want to compute the mass and
I want to ask how to add a computed column in BIRT that compute
I want to compute the minimum size both vertical and horizontal that will contain
I want to compute the moment of inertia of a (2D) concave polygon. I
Probably very simple question (I just want to ensure I'm right). Title is not

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.