[RESOLVED] reliable decimal to fraction converter
I have some code for converting a decimal to a fraction: Code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim input As Decimal...
View ArticleExpression Evaluator - Parenthesis and Negatives
Hi y'all. I'm ultimately working towards a parser, but I figured that I'd start small and create an expression evaluator. This is what I have so far: Code: Private operators() As String = {"-",...
View Article[RESOLVED] Expression Evaluator - Parenthesis and Negatives
Hi y'all. I'm ultimately working towards a parser, but I figured that I'd start small and create an expression evaluator. This is what I have so far: Code: Private operators() As String = {"-",...
View Article[RESOLVED] Normalized range
I've got two numbers, A and B. I don't know which is bigger at the outset. I'm trying to work out a math function that will use the two numbers (without IF statements) and end in a result from 0 to 2,...
View Article[RESOLVED] Permutations on 6 decks of cards.
The number of ways a single deck of cards can be arranged is easy. 52!. Or 8x10^67. But how would I get the number for six decks together? It won't be 310! as it doesn't matter which of the six...
View ArticleThree guys rent a room for $30
Three guys rent a room for $30 They walk to their room The Hotel manager realized a mistake was made Informs the bell hop to return $5 to the three guys While walking to the room, the bell hop, thinks,...
View ArticleMaximum Yards Returned
I'm creating a football(American) game and I need some help with returning the amount of yards returned from a method based on different properties. For example, there are 2 key properties for a kicker...
View Article[RESOLVED] Average from percentage?
I'm feeling dumb right now. I have a loop, and each iteration there's an effect that shows up N% of the time. If it fails to show up a total of M times, the effect goes away (is no longer checked for)....
View Article[RESOLVED] Gaussian Sigma and Pascal's Triangle
We all know (don't we? :)) that the numbers in given row of Pascal's triangle divided by their total give the coefficients of a 1-dimensional Gaussian kernel. How can I derive the Sigma of the...
View ArticleA long weekend visiting
A long weekend visiting a planet 1,200 trillion miles away, may not be a realistic prospect just yet, but that hasn't stopped scientists at NASA from dreaming.
View ArticleThe U.S. space agency's
The U.S. space agency's Jet Propulsion Laboratory at the California Institute of Technology has created a series of posters advertising imaginary vacations to some of them.Watch The Woman in Black 2:...
View ArticleThe planet is depicted as a rocky
The planet is depicted as a rocky, terrestrial world, NASA says it could also be a gas giant like Saturn with freezing temperatures that would make it hostile to known lifeformsWatch The Hobbit: The...
View Article[RESOLVED] Rotating 3d Object by Axis
I'm reworking on an old project 3d GDI+ library and I would like to rotate an object by it's x, y, and z axis'. I'm following this website's instructions on how to do the actual rotating, but I'm...
View Article[RESOLVED] drawing random triangle
I'm writing an application where I need to be able to draw a scale random triangle. So far I've defined the max bounding rectangle (170,170) and defined random angles: Code: Public Class Form1 Dim...
View Articleradius of circumcircle from 3 points formula... can someone explain?
Why is it that this formula works? Code: r=a*b*c/sqrt((a+b-c)(b+c-a)(c+a-b)(a+b+c)) this formula finds the radius of the circumcircle of a triangle (or three points, combining it with pythagoras),...
View Article[RESOLVED] Round-about way to get even distribution using Random functions.
I have a list of entities that can be targeted. Lets the list has 10 entities and the entity doing the targeting selects one at random. Its a simple matter of rnd.Next(0,10) which gives each of the 10...
View Article[RESOLVED] solving equation
I have an equation that I'm trying to solve: y =- x²⁄16 + 21x⁄16 + 11⁄8 Multiply through by 16: 16y = -x² + 21x + 22 But that's as far as I can get. I'd understand it if it was: y = -x² + 21x + 22 = 0...
View Articleshellsort and selectionsort code help
Hello guys, I'm new here and obviously I am a total Vb-newbie .. and i have a question. I'm trying to generate random numbers and then sort them. So I did the code for the 'random-generate'-stuff but...
View ArticleSolving Triangles
Assuming I have a triangle with sides a,b,c and angles A,B,C, where side a is opposite angle A etc... what is the minimum sides and angles I need in order to calculate all 3 sides and all 3 angles...
View Article[RESOLVED] Generating parallel lines.
I have a line defined by coordinates (x1,y1,x2,y2) and pairs of circles that are centered on (x1,y1). What I am looking for is a way to calculate the line coords for a connection between circles that...
View Article