Conversion of create_curves, loglet_func, and linspace into R