My Math Forum Logaritm expression simplification
 User Name Remember Me? Password

 Calculus Calculus Math Forum

 July 23rd, 2011, 02:15 PM #1 Newbie   Joined: Jul 2011 Posts: 1 Thanks: 0 Logaritm expression simplification Hi i´m trying to make a better expression to this logaritm problem, but i couldn´t understand what i´m doing wrong...Can someone help me solvingthis ? The expression is to compute the Hue from a RGB color data: Hue = tan-1( (log(R) - log (G)) / ( log (R) - log (G) +2*log(B) ) On the logaritm part i made a error that i can´t solve..i achieve this: ( (log(R) - log (G)) / ( log (R) - log (G) +2*log(B) ) = log2(R/G)/log2(B*B*R/G) ? whit this is wrong ? What is the proper solution for the logaritm part ? The log part must be on a basis of 2, because i´m trying to make a better approach to a assembly function. I achieved the result separating the quotients and dividends like this: quotient = log(R)-log(G) = log(R/G) = log2(R/G)*log10(2) dividend = (log(R)-log(G)+2*log(B)) = log(R/G)+log(B)+log(B) = log(B*B*R/G) = log2(B*B*R/G)*log10(2) Resulting in: log2(R/G) / log2(B*B*R/G) But this is wrong...why ? Note: After solving the logaritm part..what is the best solution for the tan-1(Result expression) ? Where tan-1 = tangent of a power of -1 = 1/tan = arctan ? or it is: 1/tan(( (log(R) - log (G)) / ( log (R) - log (G) +2*log(B) )) ??? Source of formula is: http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf Best Regards, guga
July 23rd, 2011, 02:41 PM   #2
Global Moderator

Joined: Oct 2008
From: London, Ontario, Canada - The Forest City

Posts: 7,923
Thanks: 1123

Math Focus: Elementary mathematics and beyond
Re: Logaritm expression simplification

Quote:
 Originally Posted by b2kguga Hue = tan-1( (log(R) - log (G)) / ( log (R) - log (G) +2*log(B) )
$\text{Hue }=\,\arctan$$\frac{\log\(\frac{R}{G}$$}{\log$$\fra c{RB^2}{G}$$\)$

arctan, that is, tan^(-1), is the inverse tangent function and it is not equivalent to 1/tan(x).

See http://en.wikipedia.org/wiki/Inverse_tr ... _functions for information on the arctan function and

http://www.programmersheaven.com/mb/x86 ... ng-arctan/

for information about coding it. (Read the entire topic).

See http://www.purplemath.com/modules/logrules.htm for information on handling logarithms.

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post Riazy Calculus 1 February 16th, 2011 10:37 PM honzik Real Analysis 1 December 26th, 2009 03:16 PM geyikrali Real Analysis 1 February 23rd, 2008 01:14 AM Xcel Algebra 1 September 6th, 2007 07:29 AM ananda Calculus 0 December 31st, 1969 04:00 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top