Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have two edges, both of which are made up of 2 3-dimensional points, forming a line segment.
Is there a relatively quick way of checking whether both of the line segments part of the same line?
Let's first segment has end points A,B , and second segment has end points C,D. Both segments belong to the same line, if
AB x AC = AB x AD = 0 (vector product)
How to do it depends on how your segments are represented, but an idea would be:
check they are collinear ( ie no intersection )
Length of the candidat must be smaller or equal
then check for start or end being on the potential container
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I tried to print every pair of element while it's factorial
language: language-c
#include<studio library>//
in main function I try to store 2D array which size is
a[1][3];
And, I write these code
integer a[1][3] = {1,2,3,4,5};
and I find factorial of 5 = 120
I have to print three element together
it is possible 120 times;
so ,I can try 120 different value using print function function
in a[1][3];
like this output
1,2,3 is 1.
1,2,4 is 2.
1,2,5 is 3.
1,3,4 is 4.
1,3,5 up to 120
I want to know that how to store value in 2D array
but the array is a[1][3]
You may set the values of j and k to be "i-dependent" but they are not updating their value, you should add a j++,k++ next to the i++
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
How do I reduce space between points in a line chart in C#. I would like to reduce the space between the points 01 and 02 and 03, it is very big. the red line is for show the space what I want to reduce.
Not sure what you want.
If you want the tick marks to appear more frequently, you will need to manipulate the Axis.MajorTickMark property.
If you like the tick marks where they are data-wise, but want them closer together, you can manipulate the Axis.Minimum property and the Axis.Maximum property. The larger the range covered by the axis, the closer together the tick marks will become.
If you want to keep the axis range the same and the tick mark values the same, your only option is to make the chart itself smaller, which will make everything closer together.
If you want to keep the minimum, maximum, chart size, and tick mark values the same, but just want them closer together, that is physically impossible, if you think about it.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have an imaginary line segment (I have the start and end of the segment) and a List of Points. I want to move this line closer to the collection of points until it hits one of them. This image should make things clearer:
In this image I want to move the green line to the red points until it hits them and get the blue line.
So I have Point startGreen, endGreen; and List<Point> redPoints. How can I get Point startBlue, endBlue;?
Follow these steps:
Calculate distance between each point and the green line
find minimum distance
move green line to the point with minimal distance
-- OR --
Find a coordiante transformation which rotates the green line to (say) the y-axis.
Transform all points
find the point with the largest x-component
Move the green line to this point.
Do the inverse trsnafomation
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a situation on my C programming here and just wondering whether my solution is the correct way:
I have a LED display with particle count sensor and will show 6 digit of seven segment numbers as the count value. The sensor will give voltage input value. The input is from 0V to 10V. So the range of 0V-10V need to be shown in the display as 000000 to 999999 count.
My solution is:
Display number = Input voltage * 99999.9
For example:
Display number = 10.000*99999.9=999999
Display number = 5.500*99999.9=549999
Display number = 2.300*99999.9=229999
Is this the correct solution? I notice that I will get a lot of 9 on the display value.
The most usable and user friendly solution is to ignore the fact that your most significant digit is capable of displaying up to 9 and simply multiply by 10000 unless you desperately need the maxim resolution in which case simply use a scale factor of 100000 and document that your range is 0-9.99999.
My reasoning is that it is better to either loose one digit in the accuracy across the whole range or clip just the maximum value than to have an error across the entire range.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is there a way to reduce the number of figures of a number?
Example:
double d = 222222222222222224444444444444.0
I want to "serialize" it like 17[2]13[4] for example.
The idea is to reduce the number of "chars" used by the number.
double d = 222222222222222224444444444444.0
You can't have a double that big in the first place.
I want to "serialize" it like 17[2]13[4] for example.
The idea is to reduce the number of "chars" used by the number.
A double only takes 8 bytes regardless of its value. There doesn't seem to be any actual point to this.