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#
Description
There are two lines in 3D space. Find their intersection.
Input:
Twelve reals:
The coordinates of a point on the first line.
The coordinates of the direction vector of the first line.
The coordinates of a point on the second line.
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:
Integer number 0 if the lines do not intersect.
Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.
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
add a comment |
Description
There are two lines in 3D space. Find their intersection.
Input:
Twelve reals:
The coordinates of a point on the first line.
The coordinates of the direction vector of the first line.
The coordinates of a point on the second line.
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:
Integer number 0 if the lines do not intersect.
Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.
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
Why do you want to ask it here.. Check this
– Irf
Mar 6 at 17:46
add a comment |
Description
There are two lines in 3D space. Find their intersection.
Input:
Twelve reals:
The coordinates of a point on the first line.
The coordinates of the direction vector of the first line.
The coordinates of a point on the second line.
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:
Integer number 0 if the lines do not intersect.
Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.
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
Description
There are two lines in 3D space. Find their intersection.
Input:
Twelve reals:
The coordinates of a point on the first line.
The coordinates of the direction vector of the first line.
The coordinates of a point on the second line.
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:
Integer number 0 if the lines do not intersect.
Integer number 1 and the 3D coordinates of the intersection if the lines intersect at one point.
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
c# .net
asked Mar 6 at 17:42
Дмитрий ЛеусДмитрий Леус
11
11
Why do you want to ask it here.. Check this
– Irf
Mar 6 at 17:46
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Why do you want to ask it here.. Check this
– Irf
Mar 6 at 17:46