Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am having an issue solving this. I wrote this equation to find the with of a bar for a bar chart that is comparative. \begin{equation} D-P*(N+1) = ((N-1)*M)*B*0.75+N*B \end{equation}

share|improve this question
    
D and P are numbers, integers. D is the size of the drawable area, P is the padding between bars. –  Jaybit Jul 3 '12 at 18:38
    
some one else edited it... should be fixed –  Jaybit Jul 3 '12 at 18:40
    
@RossMillikan Yeah, my bad sorry for confusion. –  m.woj Jul 3 '12 at 18:41

1 Answer 1

up vote 1 down vote accepted

No guarantee that the result will be an integer, but just distribute the $B$ out of the terms on the right and divide.

$\begin{equation} D-P*(N+1) = ((N-1)*M)*B*0.75+N*B \end{equation}$

$\begin{equation} D-P*(N+1) =( ((N-1)*M)*0.75+N)*B \end{equation}$

$\begin{equation} (D-P*(N+1))/( ((N-1)*M)*0.75+N)=B \end{equation}$

share|improve this answer
    
Thanks, Looks good. Forgot about taking B out of the terms on the right. –  Jaybit Jul 3 '12 at 18:44
    
Is "*" a common operator for multiplication? I thought it was "\times" or "\cdot"? –  Gigili Jul 3 '12 at 18:56
1  
@Gigili: Some people use it. It is easier in handwriting to distinguish from the variable $x$. Many programming languages use it. I followed the OP which let me copy/paste. –  Ross Millikan Jul 3 '12 at 18:59
    
@RossMillikan: Ah OK, good to know. Thanks. Actually I was aware of the programming usage of it but I recalled someone recommended to avoid using it in LaTeX. –  Gigili Jul 3 '12 at 19:10
    
My first math question on math.stackexchange... I am a programmer so I always use stackOverflow. In programming * is a common for multiplication. Here is the equation in objective-c: float barWidth = (drawableArea-SECTION_SPACING*([barArray count]+1)) / ((([barArray count]-1)*[barSetArray count])*0.75+[barArray count]); –  Jaybit Jul 3 '12 at 21:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.