|
OK, if in three dimensional space you have a surface described by f(x,y,z)=0 then all points P(X,Y,Z) that make f(X,Y,Z)>0 will lie on one side, and those making f<0 will lie on the other side. So check one point to see what you choose to call the inside, and you will know for all points.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
My description is not good enough, it's "too" specific for my particular "problem", With an actual cylinder, and vector, I can resolve it.
I will try to have a better description.
Thanks.
This signature was proudly tested on animals.
|
|
|
|
|
Are you using cylindrical coordinates? In that case, rho should be your radial vector.
You can define rho to be positive if it points outward from the axis of the cylinder and negative if it points inwards.
|
|
|
|
|
Since you simply have a direction and an axis, on one side it points toward the axis and on the other away from the axis.
[<--------O<-------]
The braces are the survace of the cylinder, the O is the axis, and well, you should get what the arrows are.
I think to do what you want, you need the vector describing the axis and a point in space to decide if the vector points toward the line or away.
"Republicans are the party that says government doesn't work and then they get elected and prove it." -- P.J. O'Rourke I'm a proud denizen of the Real Soapbox[ ^] ACCEPT NO SUBSTITUTES!!!
|
|
|
|
|
It's ugly, but you could calculate the slope and quadrant (octant?) of each spoke (assuming the axis is defined to be the origin, or using translation to make it so).
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi to all of you guys here…
May this thread fits on this section. A friend of mine gave me this enigma. It is written in Excel format. Since here I can’t attach .xls file, I don't know how to put the file, name Enigma.xls.
There are infinite amount of tables, with ten rows (row 0,1,2,….9) each. Inside of each tables, there are numbers from 1 to 92, 93 to 184, 185 to 276, and 277 to 284, which lie on their certain rows. Here I gave the example tables that have been filled in for 40 tables. By finding the patterns/ formulas, my friend asked me to extend the tables to fill in the blank tables 41,42,43,etc as given beneath of Table 40. Just like SUDOKU, in each tables there will be no same numbers vertically, horizontally and diagonally. If these tables are using permutations from an ideal table that you can see beneath Table 40 (supposed the ideal table was right), then how to find the formulas of its permutations?
Can somebody help me about this?
Thx.
Hope my English is good enough for explaining this.
modified on Tuesday, March 31, 2009 11:52 PM
|
|
|
|
|
Someone has made a program in Java like this:
import java.util.*;
public class Table {
static Scanner console = new Scanner(System.in);
public static void main (String[] args)
{
String list = "010509131741454953572125293337616569737702030406070810111214" +
"151618192022232426272830313234353638394042434446474850515254" +
"5556585960626364666768707172747576787980818283848586878889909192";
String number;
int counter = 0;
int randomNumber = 0;
int rowPlacement = 0;
Vector row_0 = new Vector();
Vector row_1 = new Vector();
Vector row_2 = new Vector();
Vector row_3 = new Vector();
Vector row_4 = new Vector();
Vector row_5 = new Vector();
Vector row_6 = new Vector();
Vector row_7 = new Vector();
Vector row_8 = new Vector();
Vector row_9 = new Vector();
for (counter=0; counter<184; counter = counter + 2)
{
number = list.substring(counter, counter + 2);
//-------------------------------------------------------------------
if (counter == 10 || counter == 20 || counter == 30 || counter >= 40)
{
rowPlacement = 0;
}
//-------------------------------------------------------------------
do
{
randomNumber = (int) ( 10 * Math.random() );
}
while (rowPlacement > randomNumber);
//-------------------------------------------------------------------
if (randomNumber == 0)
{
row_0.addElement(number);
rowPlacement = 0;
}
else if (randomNumber == 1)
{
row_1.addElement(number);
rowPlacement = 1;
}
else if (randomNumber == 2)
{
row_2.addElement(number);
rowPlacement = 2;
}
else if (randomNumber == 3)
{
row_3.addElement(number);
rowPlacement = 3;
}
else if (randomNumber == 4)
{
row_4.addElement(number);
rowPlacement = 4;
}
else if (randomNumber == 5)
{
row_5.addElement(number);
rowPlacement = 5;
}
else if (randomNumber == 6)
{
row_6.addElement(number);
rowPlacement = 6;
}
else if (randomNumber == 7)
{
row_7.addElement(number);
rowPlacement = 7;
}
else if (randomNumber == 8)
{
row_8.addElement(number);
rowPlacement = 8;
}
else if (randomNumber == 9)
{
row_9.addElement(number);
rowPlacement = 9;
}
}
System.out.println(row_0);
System.out.println(row_1);
System.out.println(row_2);
System.out.println(row_3);
System.out.println(row_4);
System.out.println(row_5);
System.out.println(row_6);
System.out.println(row_7);
System.out.println(row_8);
System.out.println(row_9);
}
}
But it didn't work correctly yet in order to result tables like I put at Mediafire.com (a file hosting service) name Enigma.xls:
http://www.mediafire.com/?sharekey=12a93ace84ea3ab56b21be4093fab7ace04e75f6e8ebb871
|
|
|
|
|
I am a c# newbie and I need a point in the right direction. I have a problem where I will have an array with an area and two nodes(upper and lower). The format for the data will be as follows:
-Upper node will always be smaller than lower node.
-Each Area only has two nodes.
-Nodes can be shared but this can be overlooked for now.
-It is like an upside down tree, however, I don't need to solve any data. I just need to find the flow of the data so that I can draw a flow chart from it. Is there an algo that would suit this task or should I just go at it myself(don't want to reinvent the wheel).
I have a jpeg that would clarify the problem if any wants me to email it to them. If this doesn't make sense let me know. Thanks.
-----
Here is the link for the image
http://i44.tinypic.com/actrma.jpg[^]
modified on Monday, March 30, 2009 4:22 PM
|
|
|
|
|
I don't really get it so I guess I need to see the picture.
But why don't you upload the jpeg to tinypic[^] and update the original post with the link and let some more people have a go at it.
Remember that most people (including me) are lazy by nature.
|
|
|
|
|
http://i44.tinypic.com/actrma.jpg[^]
Essentially, it is an upside down tree. I don't need to solve data, just develop the flow diagram given the numerical data(area, upper and lower nodes).
I was going to create an array and populate it like a grid and then call my graphics function to print the flowchart. I don't know if this is effective (I am a civil engineer and a c# newbie). There shouldn't be more than 40 areas given to solve for and there shouldn't be more than 4 branches.
The data i will have will look like this:
area---upper node---lower node
1----101----------102
2----102----------103
3----103----------104
.......
8----108----------111
etc...
Thanks for any guidance.
modified on Monday, March 30, 2009 4:40 PM
|
|
|
|
|
Is my question not valid or unworthy?
|
|
|
|
|
The question is fine - I'm not sure anyone has a solution...
|
|
|
|
|
who can help me to solve the problem about 30 exercise in chapter 11, Graph Theory [Reinhard Diestel, 2005] or 30 exercise in chapter 8, Graph Theory [Reinhard Diestel, 2005] ?thanks!!!!!!!!!
|
|
|
|
|
|
Hi,
I am trying to write a VC++ application that will increase the CPU load on a Windows machine.
I am specifically trying to make this application take up say 'X'% of the total CPU usage. Though I have a few ideas in mind like trying to run some sort of indefinite loop, I can't make or even restrict the app to take up only 'X'% of the CPU clock cycles.
I would really appreciate any ideas for algorithms from the creative geniuses out there that would load the CPU to about 'X'% (Need not be exactly 'X', a generous approximation would do for me!). Pls do have in mind that 'X' is a variable here (I'm thinking of at least 4 possible values - 25, 50, 75, 95/100).
Thanks in advance!
~Rennie.
|
|
|
|
|
I guess that you were looking for this[^] article?
I are troll
|
|
|
|
|
Hi,
a simple control engineering approach:
TimeSpan some=33milliseconds;
forever {
if (getCumulativeCPUload() < wantedCPUload) busyLoop(some);
else sleep(some);
}
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks for the suggestions!
But I guess I didn't really spell out my question properly. I am not looking for a way to make a random value approximate to a given 'X' value and I also do know how to get CPU usage data from the system. ...
What I am looking for are ideas to load the CPU and in the process control exactly how much CPU usage my application (that will host the algorithm) will generate!
For example when I tried to execute something like this - sqrt(rand()) - inside a indefinite loop, I am able to generate considerable CPU usage, but then I can't control exactly how much this would take up. So the requirement is for 'a generic algorithm which will load the CPU in a controlled arithmetic fashion (not haphazardly) & also manipulate how much CPU it uses up simply by taking a different set of input values'.
Hope I've made my query clear! So any ideas?
|
|
|
|
|
"Exactly" isn't possible, as you're not the only running proces. Luc [^]has posted you some pseudocode that can be used to load the CPU to a specified percentage.
Here's a possible implementation of that pseudocode;
static void SimulateProcessorLoad(int wantedCPUload)
{
PerformanceCounter cpuCounter = new PerformanceCounter()
{
CategoryName = "Processor",
CounterName = "% Processor Time",
InstanceName = "_Total"
};
do
{
if (cpuCounter.NextValue() < wantedCPUload)
busyLoop();
else
Thread.Sleep(33);
} while (true);
}
The idea's; use a PerformanceCounter to get the current CPU-load. If the load is too high, do a Sleep . If the load isn't high enough, fake some processing
I are troll
|
|
|
|
|
hi all,
Can anyone tell me the math behind this MS Excel functions. I am writing software for iPhone and I want to use the functionality like FV function of Excel.Also i want to only pass first three argument
|
|
|
|
|
Buy a CRC manual, or any basic business math textbook. Both contain formulas for calculating future values, though the CRC manual uses tables rather than formulas for the calculations.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi, please give me some hints as how to do this.
Assuming a three-bit exponent field and a four-bit mantissa, write the 8-bit pattern for the following decimal values:
a.13.0
b.0.3125
A. 13.0
positive so first bit 0
exponent = 000
mantissa = 1101
=0000 1101
B. 0.3125
=3.125x10-1
positive so first bit 0
exponent = offset by 4 because 2^3 = 8 / 2 = 4 ... so 4 - 1 = 3 = 011 in binary
Mantissa = 3.125 = 0011.001
= 0011 0011.001
is this correct? please help
|
|
|
|
|
Sadaiyappan wrote: is this correct? please help
I'm not telling.
This smells like a home work to me. I never, never, was afraid of passing wrong answer. Besides the objective of going to school is learning not getting marks. If I make a mistake, there lies an opportunity to learn.
why don't you pass it as it is, and wait to see what comes out. That way you learn. Either it will reinforce what you know or you will learn from your mistake.
What do you think?
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
I would say:
13.0 <=> 01101010
3.125 <=> 01001001
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the mantissa would be correct for those FP formats that hide the first mantissa bit.
There are several conventions about exponent offset, I haven't met yours yet.
The OP's format was not fully defined.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|