feat: add power scaling factor to plot generation in plot.py

The plot.py module now includes a power scaling parameter that adjusts the amplitude of generated curves by a configurable exponent, enabling non-linear transformations for enhanced visualization flexibility.
This commit is contained in:
2025-12-04 05:14:22 +00:00
parent e768ed066c
commit ed69521892
18 changed files with 930 additions and 236 deletions
+7 -1
View File
@@ -1,5 +1,6 @@
#define _POSIX_C_SOURCE 200809L
#include "lexer.h"
#include "../utils/safe_alloc.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -73,7 +74,12 @@ RavaToken_t* rava_lexer_parse_string(RavaLexer_t *lexer) {
if (length + 1 >= capacity) {
capacity *= 2;
str = realloc(str, capacity);
char *new_str = rava_safe_realloc(str, capacity);
if (!new_str) {
lexer->error_message = strdup("Out of memory");
return _rava_lexer_create_token(lexer, RAVA_TOKEN_ERROR);
}
str = new_str;
}
str[length++] = c;
}