Intersection of Two 3D Lines2019 Community Moderator ElectionReplace Line Breaks in a String C#What do two question marks together mean in C#?Best way to parse command line arguments in C#?How to intersect two polygons?Calculate difference between two dates (number of days)?The opposite of Intersect()Datatable data at different frequenciesFind intersection of polygon and order by lineNot able to access JSON datasgrahams scan to implement polygon partition in c#

Want to switch to tankless, but can I use my existing wiring?

Why don't MCU characters ever seem to have language issues?

Plywood subfloor won't screw down in a trailer home

Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?

Why do Australian milk farmers need to protest supermarkets' milk price?

What is the likely impact on flights of grounding an entire aircraft series?

How could a female member of a species produce eggs unto death?

What is the difference between "shut" and "close"?

Is a lawful good "antagonist" effective?

Is "history" a male-biased word ("his+story")?

Is it ok to include an epilogue dedicated to colleagues who passed away in the end of the manuscript?

Running a subshell from the middle of the current command

Sword in the Stone story where the sword was held in place by electromagnets

Is it illegal in Germany to take sick leave if you caused your own illness with food?

Is this animal really missing?

Can "semicircle" be used to refer to a part-circle that is not a exact half-circle?

validation vs test vs training accuracy, which one to compare for claiming overfit?

Force user to remove USB token

Is all copper pipe pretty much the same?

Word for a person who has no opinion about whether god exists

Single word request: Harming the benefactor

Are there situations where a child is permitted to refer to their parent by their first name?

Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?

How to make readers know that my work has used a hidden constraint?



Intersection of Two 3D Lines



2019 Community Moderator ElectionReplace Line Breaks in a String C#What do two question marks together mean in C#?Best way to parse command line arguments in C#?How to intersect two polygons?Calculate difference between two dates (number of days)?The opposite of Intersect()Datatable data at different frequenciesFind intersection of polygon and order by lineNot able to access JSON datasgrahams scan to implement polygon partition in c#










-3















Description



There are two lines in 3D space. Find their intersection.



Input:



Twelve reals:



  1. The coordinates of a point on the first line.


  2. The coordinates of the direction vector of the first line.


  3. The coordinates of a point on the second line.


  4. The coordinates of the direction vector of the second line.


Each length of the direction vectors is greater than 1e-8.



Output:



There are the following output cases:



  1. Integer number 0 if the lines do not intersect.


  2. Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.


  3. Integer number 2, the 3D coordinates of any point on the line, and the 3D coordinates of the normalized direction vector of the line if the lines coincide.


Project code: IntersectionOfTwo3DLines



Requirements



Examples:



Input:



0.0 0.0 0.0 1.0 0.0 0.0 3.0 5.0 4.0 0.0 1.0 0.0



Output:



0



Input:



1.0 2.0 3.0 1.0 1.0 1.0 -3.0 9.0 2.0 -3.0 8.0 0.0



Output:



1 0.0 1.0 2.0



Input:



7.0 7.0 7.0 500.0 500.0 500.0 -3.0 -3.0 -3.0 -8.0 -8.0 -8.0



Output:



2 7.0 7.0 7.0 0.577350269 0.577350269 0.577350269










share|improve this question






















  • Why do you want to ask it here.. Check this

    – Irf
    Mar 6 at 17:46















-3















Description



There are two lines in 3D space. Find their intersection.



Input:



Twelve reals:



  1. The coordinates of a point on the first line.


  2. The coordinates of the direction vector of the first line.


  3. The coordinates of a point on the second line.


  4. The coordinates of the direction vector of the second line.


Each length of the direction vectors is greater than 1e-8.



Output:



There are the following output cases:



  1. Integer number 0 if the lines do not intersect.


  2. Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.


  3. Integer number 2, the 3D coordinates of any point on the line, and the 3D coordinates of the normalized direction vector of the line if the lines coincide.


Project code: IntersectionOfTwo3DLines



Requirements



Examples:



Input:



0.0 0.0 0.0 1.0 0.0 0.0 3.0 5.0 4.0 0.0 1.0 0.0



Output:



0



Input:



1.0 2.0 3.0 1.0 1.0 1.0 -3.0 9.0 2.0 -3.0 8.0 0.0



Output:



1 0.0 1.0 2.0



Input:



7.0 7.0 7.0 500.0 500.0 500.0 -3.0 -3.0 -3.0 -8.0 -8.0 -8.0



Output:



2 7.0 7.0 7.0 0.577350269 0.577350269 0.577350269










share|improve this question






















  • Why do you want to ask it here.. Check this

    – Irf
    Mar 6 at 17:46













-3












-3








-3








Description



There are two lines in 3D space. Find their intersection.



Input:



Twelve reals:



  1. The coordinates of a point on the first line.


  2. The coordinates of the direction vector of the first line.


  3. The coordinates of a point on the second line.


  4. The coordinates of the direction vector of the second line.


Each length of the direction vectors is greater than 1e-8.



Output:



There are the following output cases:



  1. Integer number 0 if the lines do not intersect.


  2. Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.


  3. Integer number 2, the 3D coordinates of any point on the line, and the 3D coordinates of the normalized direction vector of the line if the lines coincide.


Project code: IntersectionOfTwo3DLines



Requirements



Examples:



Input:



0.0 0.0 0.0 1.0 0.0 0.0 3.0 5.0 4.0 0.0 1.0 0.0



Output:



0



Input:



1.0 2.0 3.0 1.0 1.0 1.0 -3.0 9.0 2.0 -3.0 8.0 0.0



Output:



1 0.0 1.0 2.0



Input:



7.0 7.0 7.0 500.0 500.0 500.0 -3.0 -3.0 -3.0 -8.0 -8.0 -8.0



Output:



2 7.0 7.0 7.0 0.577350269 0.577350269 0.577350269










share|improve this question














Description



There are two lines in 3D space. Find their intersection.



Input:



Twelve reals:



  1. The coordinates of a point on the first line.


  2. The coordinates of the direction vector of the first line.


  3. The coordinates of a point on the second line.


  4. The coordinates of the direction vector of the second line.


Each length of the direction vectors is greater than 1e-8.



Output:



There are the following output cases:



  1. Integer number 0 if the lines do not intersect.


  2. Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.


  3. Integer number 2, the 3D coordinates of any point on the line, and the 3D coordinates of the normalized direction vector of the line if the lines coincide.


Project code: IntersectionOfTwo3DLines



Requirements



Examples:



Input:



0.0 0.0 0.0 1.0 0.0 0.0 3.0 5.0 4.0 0.0 1.0 0.0



Output:



0



Input:



1.0 2.0 3.0 1.0 1.0 1.0 -3.0 9.0 2.0 -3.0 8.0 0.0



Output:



1 0.0 1.0 2.0



Input:



7.0 7.0 7.0 500.0 500.0 500.0 -3.0 -3.0 -3.0 -8.0 -8.0 -8.0



Output:



2 7.0 7.0 7.0 0.577350269 0.577350269 0.577350269







c# .net






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 6 at 17:42









Дмитрий ЛеусДмитрий Леус

11




11












  • Why do you want to ask it here.. Check this

    – Irf
    Mar 6 at 17:46

















  • Why do you want to ask it here.. Check this

    – Irf
    Mar 6 at 17:46
















Why do you want to ask it here.. Check this

– Irf
Mar 6 at 17:46





Why do you want to ask it here.. Check this

– Irf
Mar 6 at 17:46












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55029199%2fintersection-of-two-3d-lines%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55029199%2fintersection-of-two-3d-lines%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

Алба-Юлія

Захаров Федір Захарович