Search Results

Search found 3425 results on 137 pages for 'polynomial math'.

Page 23/137 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Maths: Determining angle in 3D space

    - by 742
    I hope this is the proper location to ask this question which is the same as this one, but expressed as pure math instead of graphically (at least I hope I translated the problem to math correctly). Considering: two vectors that are orthogonal: Up (ux, uy, uz) and Look (lx, ly, lz) a plane P which is perpendicular to Look (hence including Up) Y1 which is the projection of Y (vertical axis) along Look onto P Question: what is the value of the angle between Y1 and Up? As mathematicians will agree, this is a very basic question, but I've been scratching my head on walls now for at least two weeks without being able to visualize the solution... maybe now too old for finding solutions to school exercises. I'm looking for the scalar trigonometric solution, not a solution using a matrix. Thanks.

    Read the article

  • Currency Math in JavaScript

    - by Jared
    Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem: I need to subtract one number from the other. The problem is that the numbers have a dollar sign (because its money), therefore jQuery is treating them as strings instead of numbers. I have created two variables - toalAssets and totalLiabilites. I would like to subtract the latter from the former and place the result into another variable called netWorth. Perhaps i need to use parseFloat()? But I'm not sure how - This is all a little over my head!

    Read the article

  • Math with interpolated variables?

    - by Idan Gazit
    Consider the following sass: $font-size: 18; $em: $font-size; $column: $font-size * 3; // The column-width of my grid in pixels $gutter: $font-size * 1; // The gutter-width of my grid in pixels $gutter-em: #{$gutter / $em}em; // The gutter-width in ems. $column-em: #{$column / $em}em; // The column-width in ems; $foo = $gutter-em / 2; // This results in a value like "1em/2". :( $bar = ($gutter-em / 2); // this doesn't work either, same as above. How can I generate a $foo that works, and that I can reuse further in other expressions?

    Read the article

  • tool for adding parentheses to equations?

    - by jedierikb
    Is there an online tool for adding parentheses to simple math equations? For example, a + b * c into a + (b * c) Those who paid more attention in math class might be able to tackle order of operations for huge equations in their head, but I could often use some help (and verification of my thinking). I often encounter other people's libraries having equations and functions I need for my code, and this would be kind of helpful for debugging and understanding. I was hoping Wolfram Alpha would do this, but the output is not easy to plug back into most programming languages e.g. a + (bc)

    Read the article

  • C++ fixed point library?

    - by uj2
    I am looking for a free C++ fixed point library (Mainly for use with embedded devices, not for arbitrary precision math). Basically, the requirements are: No unnecessary runtime overhead: whatever can be done at compile time, should be done at compile time. Ability to transparently switch code between fixed and floating point, with no inherent overhead. Fixed point math functions. There's no much point using fixed point if you need to cast back and forth in order to take a square root. Small footprint. Any suggestions?

    Read the article

  • Can a math intensive application cause a crash?

    - by philcolbourn
    I have been messing with hash functions and functions to generate primes etc. I had 3 lock-ups in a short period. This was odd since my macbook rarely locks-up and usually only when I run out of memory - which does not happen often. But in this case, I had three in a row and none since (but I also am not generating as much load as before).

    Read the article

  • python gui generate math equation

    - by Nero Dietrich
    I have a homework question for one specific item with python GUIs. My goal is to create a GUI that asks a random mathematical equation and if the equation is evaluated correctly, then I will receive a message stating that it is correct. My main problem is finding out where to place my statements so that they show up in the labels; I have 1 textbox which generates the random equation, the next textbox is blank for me to enter the solution, and then an "Enter" button at the end to evaluate my solution. It looks like this: [randomly generated equation][Empty space to enter solution] [ENTER] I've managed to get the layout and the evaluate parameters, but I don't know where to go from here. This is my code so far: class Equation(Frame): def __init__(self,parent=None): Frame.__init__(self, parent) self.pack() Equation.make_widgets(self) Equation.new_problem(self) def make_widgets(self): Label(self).grid(row=0, column=1) ent = Entry(self) ent.grid(row=0, column=1) Label(self).grid(row=0, column=2) ent = Entry(self) ent.grid(row=0, column=2) Button(self, text='Enter', command=self.evaluate).grid(row=0, column=3) def new_problem(self): pass def evaluate(self): result = eval(self.get()) self.delete(0, END) self.insert(END, result) print('Correct')

    Read the article

  • Efficient implementation of natural logarithm (ln) and exponentiation

    - by Donotalo
    Basically, I'm looking for implementation of log() and exp() functions provided in C library <math.h>. I'm working with 8 bit microcontrollers (OKI 411 and 431). I need to calculate Mean Kinetic Temperature. The requirement is that we should be able to calculate MKT as fast as possible and with as little code memory as possible. The compiler comes with log() and exp() functions in <math.h>. But calling either function and linking with the library causes the code size to increase by 5 Kilobytes, which will not fit in one of the micro we work with (OKI 411), because our code already consumed ~12K of available ~15K code memory. The implementation I'm looking for should not use any other C library functions (like pow(), sqrt() etc). This is because all library functions are packed in one library and even if one function is called, the linker will bring whole 5K library to code memory.

    Read the article

  • C++Math evaluating incorrectly

    - by Hayden
    I thought I can make life a little easier in data statistics by making a small program which returns the results of sampling distribution of the mean (with standard error). It does this part successfully but in an attempt to return the z-score by using the formula I found here, it returns -1#IND. My interpretation of that formula is: ((1/(sqrt(2*pi)*stdev))*pow(e, (normalpow)) where double normalpow=-0.5*((mean-popmean)*(mean-popmean)/stdev) I did a little more investigating and found that (mean-popmean)*(mean-popmean) was evaluating to 0 no matter what. How can I get around this problem of normalpow evaluating to 0.

    Read the article

  • PHP: Manage roles with math?

    - by Mike
    I once saw an article about how to use a specific type of numbering system to manage roles. A user would be assigned a specific role number and depending on a calculation, the number could stand for multiple roles. Can anybody share this technique with me or share a link? Thanks!

    Read the article

  • python - returns incorrect positive #

    - by tekknolagi
    what i'm trying to do is write a quadratic equation solver but when the solution should be -1, as in quadratic(2, 4, 2) it returns 1 what am i doing wrong? #!/usr/bin/python import math def quadratic(a, b, c): #a = raw_input("What\'s your `a` value?\t") #b = raw_input("What\'s your `b` value?\t") #c = raw_input("What\'s your `c` value?\t") a, b, c = float(a), float(b), float(c) disc = (b*b)-(4*a*c) print "Discriminant is:\n" + str(disc) if disc = 0: root = math.sqrt(disc) top1 = b + root top2 = b - root sol1 = top1/(2*a) sol2 = top2/(2*a) if sol1 != sol2: print "Solution 1:\n" + str(sol1) + "\nSolution 2:\n" + str(sol2) if sol1 == sol2: print "One solution:\n" + str(sol1) else: print "No solution!" EDIT: it returns the following... import mathmodules mathmodules.quadratic(2, 4, 2) Discriminant is: 0.0 One solution: 1.0

    Read the article

  • MySQL Query involving column names containing math operators

    - by devil_fingers
    I'm a MySQL scrub, and I have asked around and checked around the internet for what I'm sure will turn out to be something obvious, but I'm very frustrated with what I thought would be a very, very simple query not working. So here goes. Please be gentle. Basically, in a large database, some of the column names contain mathematical operators like "/" and "+." (Don't ask, it's not my database, I can't do anything about it). Here is the "essence" of my query (I took out the irrelevant stuff for the sake of this question): SELECT PlayerId, Season, WPA/LI AS WPALI FROM tht.stats_batting_master WHERE Season = "2010" AND teamid > 0 AND PA >= 502 GROUP BY playerid ORDER BY WPALI DESC When I run this, it returns "Unknown column 'LI' in 'field list'," I assume because it sees the "/" in WPA/LI as a division sign. Like I said, I'm sure this is easy enough to work around (it must be given how much this database is used), but I haven't' been able to figure out how. Thanks in advance for any help.

    Read the article

  • How to determine the radius and center of a circle when only three noncollinear points are known?

    - by Bob
    I'm working on a C# program that deals with Oracle Spatial geometry. When circle data is stored in a geometry field only three non-collinear points are stored to represent the circle. The problem is that I need to use this data on a Google Maps web page and need the center point and radius of the circle (since my circle drawing function uses that information). Can anyone help with the math involved and translating said math to C#? I think this page may hold the answer, but I'm having a hard time following it. There are formulas for radius and center given three points, but then they define the variables as matrices and I get lost at that point. How would I solve that in code?

    Read the article

  • How to setup Math program

    - by Miles
    I'm needing to write a program (C#) that will allow the user to create generic formulas with variables and numbers. For example: D = A + (A - C / X)(7.8 - 6.6) F = E + (E - C / X)(7.8 - 6.6) FinalResult = (A + D)(0.9) + (E + F)(0.32) + B(0.1) + .023 where all variables would mean for me to go to a database and look something up based on values and return a number in its place. So A would be 2.12 for example (and the same for C and E) Whats the best way to structure this program? How would I make my program read these formulas? I've seen a little bit of the MathML but not sure how to get that started (or an example of it)

    Read the article

  • game currency convert: math efficient

    - by Comradsky
    For variables:4 text views named diamondText, goldText, silverText, and bronzeText;money variable unsigned int money;and an NSTimer, every .1 sec,runs function: -(void)updateMoney{ money++; bronzeText.text = [NSString stringWithFormat:@"%d",money]; silverText.text = [NSString stringWithFormat:@"%d",money%10]; goldText.text = [NSString stringWithFormat:@"%d",money%100]; diamondText.text= [NSString stringWithFormat:@"%d",money%1000]; } Given that my currency is diamond = 10 gold = 10 silver = 10 bronze = 1; What would be most efficient way to calculate and display the money labels? How would you store this variable, with GameCenter and NSDictionary or GameCenter and something else? More details are below if you don't understand. To clarify: bronze has the last 2 numbers, silver has the next 2 numbers, and so on. I understand I could use 4 ints or an array, but i would rather try to use this method, unless theres a much more efficient way. Example: When money = 1000;bronzeText = nothing, silverText = 10,goldText = nothing, diamondText = nothing; What other ways would you do this that you think would be more efficient? I will be calling a function (void)collisionDetector that detects if my player.frame crosses with a flyingObject.frame, and if that object is a coin it gives an added value to money and then calls (void)updateMoney. Im just using the timer to test this and spawn these flying objects.

    Read the article

  • Text + randomchar dosn't work [JavaScript]

    - by user558773
    <script> function makeid() { var text = "var text = document.write(lastNumber);"; var possible = "*+-/"; for( var i=0; i < 1; i++ ) document.write(lastNumber + possible.charAt(Math.floor(Math.random() * possible.length)); return text; } document.write(makeid(1))</script> How do i make this to type for ex: 23* 45- 13/ and so on. What is wrong? It just show me 2 numbers and no char after.

    Read the article

  • Typing math formulas in LaTex and getting them in MathType format?

    - by Tim
    I am asked to type some math formulas that can work in Microsoft Office and MathType equation editor. But I only have access to Ubuntu 12.04 near me, there is LibreOffice available under Ubuntu as well, but I am used to type math formulas in LaTex. So I wonder how to provide math formulas that will work in Microsoft Office and MathType, if I work under Ubuntu, preferably with LaTex but LibreOffice being also acceptable since it is still under Ubuntu? Thanks and regards!

    Read the article

  • Faut-il être bon en math pour être un bon développeur ? Quelle place ont les maths dans votre parcou

    Faut-il être bon en math pour être un bon développeur ? Quelle place ont les maths dans votre métier et votre parcours ? Faut-il être bon en math pour être un bon développeur ? La question mérite d'être posée. Certes, l'informatique est à classer, dans le système universitaire, du coté des sciences "dures", par oppositions aux sciences sociales et humaines. L'enseignement des mathématiques et la rigueur qu'elles amènent paraissent donc indispensable. Pourtant, beaucoup, comme Alan Skorkin - qui vient d'aborder ce sujet sur son blog -, reconnaissent qu'ils n'ont jamais vraiment eu besoin des maths dans leur travail. La position de Alan Skorkin est c...

    Read the article

  • Graph theory in python

    - by Dan
    I was wondering how people deal with graph theory in python? How is a graph stored? Are there libraries for this? For example how would I input a graph and then find its Chromatic polynomial? Or its girth? Or the number of unique spanning trees? How about problems that involve edge weight like salesman problems? I don't need all of these answered, I'm just looking for a method or tool set that will be able to help me approach solve problems like this. Thanks, Dan

    Read the article

  • glm matrix conversion for DirectX

    - by niktehpui
    For on of the coursework specification I need to work with DirectX, so I tried to implement a DirectX Renderer in my small cross-platform framework (to have it optionally available for Windows). Since I want to stick to my dependencies I want use glm for vector/matrix/quaternions math. The vectors seem to be fully compatible with DirectX, but the glm::mat4 is not working properly in DirectX Effects Framework. I assumed the reason is that DirectX uses row majors layouts and OpenGL column majors (although if I remember right internally in HLSL DX uses column major as well), so I transposed the matrix, but I still get no proper results compared to using XNA-Math. XNA-Version of the code (works): XMMATRIX world = XMMatrixIdentity(); XMMATRIX view = XMMatrixLookAtLH(XMVectorSet(5.0, 5.0, 5.0, 1.0f), XMVectorZero(), XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f)); XMMATRIX proj = XMMatrixPerspectiveFovLH(0.25f*3.14f, 1.25f, 1.0f, 1000.0f); XMMATRIX worldViewProj = world*view*proj; m_fxWorldViewProj->SetMatrix(reinterpret_cast<float*>(&worldViewProj)); This works flawlessly and displays the expected colored cube. GLM-Version (does not work): glm::mat4 world(1.0f); glm::mat4 view = glm::lookAt(glm::vec3(5.0f, 5.0f, 5.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f)); glm::mat4 proj = glm::perspective(0.25f*3.14f, 1.25f, 1.0f, 1000.0f); glm::mat4 worldViewProj = glm::transpose(world*view*proj); m_fxWorldViewProj->SetMatrix(glm::value_ptr(worldViewProj)); Displays nothing, screen stays black. I really would like to stick to glm on all platforms.

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >