Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by MarkenhXu · Dec 03, 2018 at 08:00 PM · vector3quaternionmathf

knowing 2 vector3, find the 3rd vector3.

alt text

How to find Vector3 of C, if we know Vector3 of the A and B. It is a right triangle.

example.png (66.9 kB)
Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fafase · Dec 03, 2018 at 08:03 PM 0
Share
 c = new Vector3(b.x, a.y, 0.0f);
avatar image MarkenhXu fafase · Dec 03, 2018 at 08:21 PM 0
Share

that is the first thing I tried, but It is almost like hard coding. if A is an object and A has a rotation, the C would be incorrect. let me see if I can add additional pictures

avatar image PizzaPie fafase · Dec 04, 2018 at 04:02 PM 0
Share

That's only true with the assumption that A and B lie on z=0 plane.

avatar image Bunny83 PizzaPie · Dec 04, 2018 at 04:30 PM 0
Share

Well, the way the problem is presented it seems to be a 2d problem. We are not here to do the work for others. If you use a different plane you should be able to adapt the given information. As it has been mentioned several times, the question is lacking a lot of details which are required to completely answer this question

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by sSuite · Dec 04, 2018 at 06:28 AM

There are an infinite number of possible points that could satisfy that -- for example: alt text

If you mean you always want the point where the legs are perfectly vertical and horizontal, you could do this:

 Vector3 c = new Vector3(b.x, a.y, 0f);

right-angle.png (71.1 kB)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Dec 04, 2018 at 01:29 PM 0
Share

Correct. This fact is covered by Thales's theorem. So if you connect two points (A and B) and draw a circle around those, all points on that circle will form a right angle when you connect it to A and B.

avatar image
0

Answer by Favouriteless · Dec 04, 2018 at 03:01 PM

It would depend if the triangle is always the same rotation.

You can replace B's Y value with A's Y value if the triangle is always the same rotation but if the triangle is not always at that rotation you may need to replace the A's values etc.

sSuite however is correct but I think you meant what I just said, not his answer.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Dec 04, 2018 at 03:38 PM 0
Share

sSuite mentioned already what you said at the end of his answer. That's also what fafase already mentioned in the comment above but the OP replied that's see$$anonymous$$gly not what he wants. So we can't answer this question any more correct as the question isn't clear to begin with. $$anonymous$$aybe he want his right triangle to be aligned with a certain object. However if that's the case he should mention it in the question because as it stands sSuite is right, there are infinitely many points that form a 90° angle.

avatar image
0

Answer by GamitusLabs · Dec 04, 2018 at 04:41 PM

The wording of the question is a bit on the bad side. However, it looks as if they are asking how to get the position of C.

It also looks as if they are assuming that the right angle is at C.

If I'm remembering my maths right, it is impossible to calculate the position of C, unless as @PizzaPie stated, the X or Y of C are on the same axis of A or B. Otherwise you need to know the length of one additional side (or one of the other angles?).

Maybe this'll help them out: https://www.mathsisfun.com/algebra/trig-finding-angle-right-triangle.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

122 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[Math] Why is this possible ? 1 Answer

Rotate Towards doesnt work as expected 2 Answers

How can I have a distance between 2 points = 0-1 (min = 0, max = 1) and in between is a decimal? [C#] 2 Answers

making a camera that moves depending on mousepos.y 0 Answers

Finding direction of objects movement, and playing an anim specific to it 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges