MHB Need help writing a pure math formula

Click For Summary
SUMMARY

The discussion focuses on converting an Excel formula into a pure mathematical formula for a website plugin. The original formula calculates a value based on the area (C) derived from the length (A) and width (B) of a rectangle. The piecewise function defined in the discussion applies different multipliers to C based on specified ranges. The user seeks assistance in expressing this logic mathematically for implementation in their plugin.

PREREQUISITES
  • Understanding of piecewise functions
  • Familiarity with mathematical notation
  • Basic knowledge of plugin development
  • Experience with programming languages used for web development
NEXT STEPS
  • Research how to implement piecewise functions in JavaScript
  • Learn about mathematical notation for functions
  • Explore plugin development frameworks for web applications
  • Investigate optimization techniques for mathematical calculations in web plugins
USEFUL FOR

Web developers, mathematicians, and anyone involved in creating or optimizing website plugins that require mathematical computations.

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?
 

Similar threads

Replies
6
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
2
Views
662
  • · Replies 17 ·
Replies
17
Views
6K
  • · Replies 5 ·
Replies
5
Views
7K
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
15K