Hidden WordScanner
Private scans · No account required

DuckieDai Exp and Log Plot Points

Give five points to plot for a transformed exponential or logarithmic function, with its asymptote, domain, and range.

exponential functions · MIT License

Overview

Give five points to plot for a transformed exponential or logarithmic function, with its asymptote, domain, and range.

  • Owner-tested on a TI calculator
  • Version 1.0.0
  • 1857 bytes
  • Uses math

Before you run it

  • TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
  • TI Connect CE .py transfer to the Python App; the owner's transfer details were not recorded
  • The function is in the form shown on the menu, with the shift inside written as x-h.
  • Points come from the parent graph's exponents -2 to 2, so they are easy to plot.
  • The base must be greater than 0 and not 1; inf and nan are asked for again.

Try the DuckieDai calculator screen

Follow the program's prompts and result flow before downloading.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

Learn the math

How to graph transformed exponential and log functions

The idea

Every exponential graph y = b^x passes through a few easy points: (0, 1), (1, b), and (-1, 1/b). A log graph y = log_b(x) is the same curve reflected over the line y = x, so its easy points are (1, 0), (b, 1), and (1/b, -1).

A transformed function moves and stretches those points. h shifts the graph left or right, k shifts it up or down, a stretches it and flips it when negative, and a minus sign inside reflects it across a vertical line. Plot the moved points, draw the asymptote, and the graph follows.

The formula

y = a*b^(x-h) + k

y = a*log_b(x-h) + k

exponential asymptote: y = k; log asymptote: x = h

a
the vertical stretch, flipping the graph when it is negative
b
the base, greater than 0 and not 1
h, k
the horizontal and vertical shifts
asymptote
the line the graph gets closer to but never reaches

Using the program

Worked example

Graph y = 2^(x-1) + 3. Choose 1 and enter a = 1, b = 2, h = 1, k = 3, and 1 for no flip.

the points (t, 2^t) of y = 2^x move to (t + 1, 2^t + 3)

The program shows (-1, 13/4), (0, 7/2), (1, 4), (2, 5), and (3, 7), then ASYMPTOTE: y = 3, DOMAIN: (-inf, inf), and RANGE: (3, inf).

Graph y = log_2(x). Choose 2 and enter a = 1, b = 2, h = 0, k = 0, and no flip. The program shows (1/4, -2), (1/2, -1), (1, 0), (2, 1), and (4, 2), with ASYMPTOTE: x = 0 and DOMAIN: (0, inf).

Tips and common mistakes

Where this comes up

Graphing transformed exponential and logarithmic functions is part of the exponential functions unit of algebra 2, precalculus, and college algebra.

Exact reviewed bytes

Source code

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. from math import exp,sqrt
  2. E=exp(1)
  3. def P():input("[enter]");print("\n"*11)
  4. def V(s):
  5. s=s.strip()
  6. if s=="e":return E
  7. if s.startswith("sqrt(") and s.endswith(")"):return sqrt(V(s[5:-1]))
  8. if "/" in s:a,b=s.split("/",1);return V(a)/V(b)
  9. return float(s)
  10. def N(p):
  11. while 1:
  12. try:
  13. v=V(input(p).lower().replace(" ",""))
  14. if v-v:raise ValueError
  15. return v
  16. except (ValueError,ZeroDivisionError):print("Enter a number")
  17. def B():
  18. while 1:
  19. try:
  20. b=V(input("Base b? ").lower().replace(" ",""))
  21. if b>0 and b!=1 and b-b==0:return b
  22. except (ValueError,ZeroDivisionError):pass
  23. print("b>0, not 1. Like:\n2 1/2 sqrt(2) e")
  24. def F(x):
  25. if abs(x-round(x))<1e-9:return str(int(round(x)))
  26. for d in range(2,101):
  27. n=round(x*d)
  28. if abs(x-n/d)<1e-8:return str(n)+"/"+str(d)
  29. return str(round(x,4))
  30. def get():
  31. a=N("a? ");b=B();h=N("h? ");k=N("k? ")
  32. s=-1 if input("Flip x inside? 1 No 2 Yes ").strip()=="2" else 1
  33. print("\n"*11);return a,b,h,k,s
  34. def pts(L):
  35. print("5 PLOT POINTS")
  36. for x,y in L:print("("+F(x)+", "+F(y)+")")
  37. P()
  38. def ex():
  39. print("y=a*b^(+/-[x-h])+k")
  40. a,b,h,k,s=get()
  41. pts([(h+s*t,a*b**t+k) for t in(-2,-1,0,1,2)])
  42. print("ASYMPTOTE: y = "+F(k)+"\nDOMAIN: (-inf, inf)")
  43. print("RANGE: "+("("+F(k)+", inf)" if a>0 else "(-inf, "+F(k)+")" if a<0 else "y = "+F(k)));P()
  44. def lg():
  45. print("y=a*log_b(+/-[x-h])+k")
  46. a,b,h,k,s=get()
  47. pts([(h+s*b**t,a*t+k) for t in(-2,-1,0,1,2)])
  48. print("ASYMPTOTE: x = "+F(h))
  49. print("DOMAIN: "+("("+F(h)+", inf)" if s==1 else "(-inf, "+F(h)+")")+"\nRANGE: (-inf, inf)");P()
  50. print("Exp/Log Points\n __\n ___(o )> quack!\n \\ <_. )\n `---'\n by DuckieDai\nhiddenwordscanner.com");P()
  51. while 1:
  52. c=input("1 Exponential\n2 Logarithmic\n3 Quit\nChoice? ").strip();print("\n"*11)
  53. try:
  54. if c=="1":ex()
  55. elif c=="2":lg()
  56. elif c=="3":break
  57. except (OverflowError,ValueError):print("Too large");P()
Filename
PLOT.py
Size
1857 bytes
SHA-256
87d7c33e525b12b637608657182b57af198deb0c31b8ddbf03bc5e99752028a6

Usage

Inputs

  • 1 for exponential y = a*b^(x-h)+k or 2 for logarithmic y = a*log_b(x-h)+k
  • a, the base b, h, and k, as numbers, fractions, sqrt( ), or e
  • Whether x is reflected inside, as in b^-(x-h) or log_b(-(x-h))

Outputs

  • Five plot points, from the key points of the parent graph
  • The asymptote, y = k or x = h
  • The domain and range

Units: Function parameters; no physical units.

Assumptions and limitations

Assumptions

  • The function is in the form shown on the menu, with the shift inside written as x-h.
  • Points come from the parent graph's exponents -2 to 2, so they are easy to plot.

Constraints

  • The base must be greater than 0 and not 1; inf and nan are asked for again.
  • Values are shown as whole numbers, fractions with bottoms up to 100, or decimals to four places.

Known failures

  • Numbers too large for the calculator show Too large and return to the menu.
  • When a is 0 the graph is a flat line, but the program still lists an asymptote.

Compatibility and review

Review status
Owner-tested on a TI calculator
Tested on
Owner reports personally running this program on a TI-84 Plus CE Python calculator; the test date, OS version, and Python App version were not recorded
What happened
Owner reported pass on the calculator before two changes: the number and base prompts now ask again when inf or nan is typed, and a result too large for the calculator now shows Too large and returns to the menu, where the original stopped with an error. Every other step is unchanged; this exact file has not yet been rerun on a calculator.
Dependencies
math
Suggested calculator name
PLOT — you can give it another valid, unique name when you transfer it
Desktop test cases
Not available for this interactive-only source

This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.

Transfer and launch

Download the .py file, send it to your calculator with TI Connect CE as PLOT or another name, then open the Python App and try the worked example on this page first. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.

Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.

Version history

Did a DuckieDai program help with your homework? Every program here is free. If you would like to say thanks, you can leave a tip on Cash App ($duckiedai214) or read what tips pay for.

Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.

Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters, and so does a Yes or No answer about whether the program worked. Your browser notes that you answered; that note is never sent to the site. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.