formula

What is a formula to get a vector perpendicular to another vector?

自作多情 提交于 2019-11-30 13:45:05
What is a formula to get a three dimensional vector B lying on the plane perpendicular to a vector A? That is, given a vector A, what is a formula f(angle,modulus) which gives a vector that is perpendicular to A, with said modulus and rotated through an angle? If the two vectors are perpendicular then their dot product is zero. So: v1(x1, y1, z1), v2(x2, y2, z2) . => x1 * x2 + y1 * y2 + z1 * z2 = 0 You know (x1, y1, z1) . Put arbitrary x2 and y2 and you will receive the corresponding z2 : z1 * z2 = -x1 * x2 - y1 * y2 => z2 = (-x1 * x2 - y1 * y2) / z1 Be aware if z1 is 0 . Then you are in the

Apply Formula Cell to a DataGridview

做~自己de王妃 提交于 2019-11-30 13:14:46
问题 I want to add formula cell in a DataGridView . Is there any custom DataGridView to do this? Example: grid[4, column].Text = string.Format("=MAX({0}6:{0}{1})", columnAsString, grid.RowCount); 回答1: Is there any custom DataGridView to do this? Off-topic, but if you are looking for a custom control, take a look at Free .NET Spreadsheet Control. Also it supports formula. If writing code for calculation is an option for you If writing code for calculation is an option for you, to calculate value of

How to calculate Number of 'Working days' between two dates in Javascript using moment.js?

妖精的绣舞 提交于 2019-11-30 11:43:24
How to calculate the number of working days between two dates in JavaScript using moment.js. I have a working formula that calculate these days, but the formula does not satisfies all conditions: here is my code: var start= moment(data[x].start_date); var end= moment(data[x].est_end_date); var difference= end.diff(start, 'days'); var workingDays= Math.round((difference/7)*5); //data[x] is for iterating over a loop I get five days per 7 days here because saturday and sunday are considered as NON-Working days, but this formula will fail if the count of the days were started from sunday or

Calculating mortgage interest in Python

筅森魡賤 提交于 2019-11-30 09:13:42
I am currently learning python through a video tutorial on youtube, and have come up against a formula I cannot seem to grasp, as nothing looks right to me. The basic concept of the excersise is to make a mortgage calculator that asks the user to input 3 pieces of information, Loan Amount, Interest Rate, and Loan Term (years) then it calculates the monthly payments to the user. here is my code: __author__ = 'Rick' # This program calculates monthly repayments on an interest rate loan/mortgage. loanAmount = input("How much do you want to borrow? \n") interestRate = input("What is the interest

Error in terms.formula(formula) : '.' in formula and no 'data' argument

冷暖自知 提交于 2019-11-30 07:04:02
问题 I'm tring to use neuralnet for prediction. Create some X: x <- cbind(seq(1, 50, 1), seq(51, 100, 1)) Create Y: y <- x[,1]*x[,2] Give them a names colnames(x) <- c('x1', 'x2') names(y) <- 'y' Make data.frame: dt <- data.frame(x, y) And now, I got error model <- neuralnet(y~., dt, hidden=10, threshold=0.01) error in terms.formula(formula) : '.' in formula and no 'data' argument For example, in lm(linear model) this is worked. 回答1: As my comment states, this looks like a bug in the non-exported

How to calculate distance based on phone acceleration

佐手、 提交于 2019-11-30 06:20:53
问题 I want to build something like this but using an android phone: http://www.youtube.com/watch?v=WOt9mb5QqRs I've already built an app that sends sensor information via socket (still looking for a good websocket implementation for android). I intend to use that information to interact with a web app, so for example i would be able to move an image based on the phone movement. The problem is that I tried to calculate distance based on the accelerometer data but the results are really bad. I

LaTeX equivalent to Google Chart API

半腔热情 提交于 2019-11-29 20:44:29
I'm currently looking at different solutions getting 2 dimensional mathematical formulas into webpages. I think that the wikipedia solution (generating png images from LaTeX sourcecode) is good enough until we get support for MathML in webbrowsers. I suddenly realized that it might be possible to create a Google Charts API equivalent for mathformulas. Has this already been done? Is it even possible due to the strange characters involved in LaTeX-code? I would like to hit an url like latex2png.org/api/?eq="E = mc^2" and get the following response: edit: Thanks for the answers sofar. However, I

What is a formula to get a vector perpendicular to another vector?

好久不见. 提交于 2019-11-29 19:05:16
问题 What is a formula to get a three dimensional vector B lying on the plane perpendicular to a vector A? That is, given a vector A, what is a formula f(angle,modulus) which gives a vector that is perpendicular to A, with said modulus and rotated through an angle? 回答1: If the two vectors are perpendicular then their dot product is zero. So: v1(x1, y1, z1), v2(x2, y2, z2) . => x1 * x2 + y1 * y2 + z1 * z2 = 0 You know (x1, y1, z1) . Put arbitrary x2 and y2 and you will receive the corresponding z2

I don't know how to display timer when stopped

◇◆丶佛笑我妖孽 提交于 2019-11-29 18:36:59
How are you all doing? I have a little problem with my code. When I stop my timer program, it will say "Done!" since I set it to "Done", but I would like to display the remaining time instead of the word "Done". Like for example if I the original time set is 4000 Seconds and I stopped at 3000 seconds I want to display the current time which is 3000 when stopping it instead of the word "Done". Can you guys help me out? I would really appreciate it. Here's my code: import java.awt.event.*; import java.awt.*; import javax.swing.*; public class CountdownTimer extends JFrame { JLabel promptLabel,

Excel formula for reverse percentage calculation

我是研究僧i 提交于 2019-11-29 17:35:43
I have a calculation which I am unable to crack. Lets say my Cost Price is 300. I want to sell the item at No Profit or No Loss. My total commission/expenses will be 30%. So it means i need to sell the item at 390. But if I do 390 - 30% = 273. How can I see the item, so that if I minus 30% to it. My Revenue will still be 300. the formula you want is =300/0.7 or =300/(1-30%) basically it is 300= x*(1-.30) where the (1-.30) is the amount that wants to be kept after the commision of 30%. Solving for x we get the above formula. You want Sell Price - 30% Sell Price = Cost Price. Combining the left