Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in. #1 2005-07-28 19:27:52
math notation to code notationhow can i write as code notation (like on programming languages like ansi-basic, C, pascal, etc.) all the math notations we can get from OpenOffice's Math editor? these can be functions or algoritms #2 2005-07-28 20:54:43
Re: math notation to code notationI don't use OpenOffice (though it sounds good!), so could you give some examples? "The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman #3 2005-08-14 05:38:22
Re: math notation to code notationan example: standard deviation formula converted to algorithm Code:'- standard deviation
setdisplay(512,256,32,1):paper(0xFFFFFF):ink(0x000000):pen(0x000000):cls
n=50
dim x[n]
while 0=0
prints("Standard Deviation"):prints("")
prints("OpenOffice formula format:")
prints("D=sqrt{sum from{i=1}to{N}(x_{i}-bar x)^{2}over{N-1}}"):prints("")
prints("getting random values..."):prints("")
for i=1 to n
x[i]=rnd(1000)
next
close #1
prints("running the formula..."):prints("")
av_x=0
for i=1 to n
av_x=av_x+x[i]
next
av_x=av_x/n
sum=0
for i=1 to n
sum=sum+(x[i]-av_x)^2
next
stp3=sum/(n-1)
d=sqr(stp3)
prints("standard deviation: "+str$(d)):prints("")
waitkey
cls
wendmy main interest is being able to convert formulas like from here: http://www.google.com/search?q=ieee+papers+pdf&sourceid=mozilla-search&start=0&start=0 to algorithm #4 2005-08-25 14:26:39
Re: math notation to code notationWow. It's been a really long time since I did any C programming, and I don't remember what Math functions are available. So, I'll give a couple simple examples in Java, which has similar syntax. Last edited by ryos (2005-08-25 14:27:35) El que pega primero pega dos veces. #6 2005-08-29 23:38:55
Re: math notation to code notationIn C, you can declare variable of various lengths, signed and unsigned numbers. #7 2005-08-30 07:26:30
Re: math notation to code notationThat sounds correct, according to my memory of C. "The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman #8 2005-09-07 07:17:47
Re: math notation to code notationHere is an example from formulas i got from an ieee paper about using fractals for compressing pictures Last edited by nitrofurano (2005-09-07 07:20:28) #9 2005-09-07 07:50:57
Re: math notation to code notationMath notation is all about concepts. There may or may not be an algorithm, or there could be lots of algorithms! "The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman #10 2005-09-07 10:38:09
Re: math notation to code notationnitrofurano: #11 2005-09-09 06:34:37
Re: math notation to code notationthanks!!! - btw, if possible, the point is how can i get to know how can i convert these formulas into algorithms - the standard deviation i knew how to do it, but stuff like calculation integrals and all of these stuff i really don't know - my math notation knowledge got stuck in the middle of highschool, and i choosed fine-arts university, so, during a long time i don't know what is math notation, and that time i had no interest about math notation as i have now (i never thaught those would be helpful for me for picture processing) |