MHB Need help writing a pure math formula

AI Thread Summary
The discussion revolves around creating a mathematical formula for a website plugin that calculates a value based on the area defined by length (A) and width (B). The area (C) is determined by the formula A * B, and then a piecewise function applies different multipliers to C based on its value. The specified ranges for C and their corresponding multipliers are outlined, with the user seeking to convert an Excel formula into a pure mathematical representation. A response indicates that the formula is a piecewise function and suggests that the programming language of the plugin may be relevant for implementation.
mcreech
Messages
1
Reaction score
0
Hello,
I am really struggling to write a math formula that I need for my website plugin.

A=(Length) B=(Width) C=(Square Inch)
A*B=C
0<=C<=16 then C*.84
17<=C<=34 then C*.70
35<=C<=65 then C*.56
66<=C<=99 then C*.42
100<=C<=150 then C*.35
151<=C<=500 then C*.31

I wrote this formula in excel, but I need a pure math formula. Here is the excel formula…G2 represents sq in. =IF(G2<=16,G20.84,IF(G2<=34,G20.7,IF(G2<=65,G20.56,IF(G2<=99,G20.42,IF(G2<=150,G20.35,IF(G2<=200,G20.31))))))Any help would be much appreciated, Thanks!
 
Technology news on Phys.org
mcreech said:
Hello,
I am really struggling to write a math formula that I need for my website plugin.

A=(Length) B=(Width) C=(Square Inch)
A*B=C
0<=C<=16 then C*.84
17<=C<=34 then C*.70
35<=C<=65 then C*.56
66<=C<=99 then C*.42
100<=C<=150 then C*.35
151<=C<=500 then C*.31

I wrote this formula in excel, but I need a pure math formula. Here is the excel formula…G2 represents sq in. =IF(G2<=16,G20.84,IF(G2<=34,G20.7,IF(G2<=65,G20.56,IF(G2<=99,G20.42,IF(G2<=150,G20.35,IF(G2<=200,G20.31))))))Any help would be much appreciated, Thanks!

Hi mcreech! Welcome to MHB! (Smile)

What you have there, is a piece wise function.
Writing it mathematically won't help to get it into a website plugin.
What is the language of your website plugin?
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top